# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
657245 | happypotato | Poi (IOI09_poi) | C++17 | 596 ms | 15956 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, t, p;
cin >> n >> t >> p;
int a[n + 1][t];
int score[n + 1], solves[n + 1];
for (int i = 1; i <= n; i++) {
score[i] = 0;
solves[i] = 0;
for (int j = 0; j < t; j++) {
cin >> a[i][j];
solves[i] += a[i][j];
}
}
for (int i = 0; i < t; i++) {
int mark = 0;
for (int j = 1; j <= n; j++) {
mark += (a[j][i] == 0);
}
for (int j = 1; j <= n; j++) {
if (a[j][i]) score[j] += mark;
}
}
int rank = 1;
for (int i = 1; i <= n; i++) {
if (i == p) continue;
if (score[i] > score[p]) rank++;
else if (score[i] == score[p]) {
if (solves[i] > solves[p]) rank++;
else if (solves[i] == solves[p]) {
if (i < p) rank++;
}
}
}
cout << score[p] << ' ' << rank << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |