# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
685066 | acceptify | Poi (IOI09_poi) | C++17 | 568 ms | 15988 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;
const int mxn = 2005;
const int mxt = 2005;
int n, t, p, ac[mxn][mxt], pt[mxt], scr[mxn], cnt[mxn], rk[mxn];
int main() {
cin >> n >> t >> p;
for (int i = 1; i <= n; i++) for (int j = 1; j <= t; j++) {
cin >> ac[i][j];
cnt[i] += ac[i][j];
pt[j] += 1 - ac[i][j];
}
for (int i = 1; i <= n; i++) for (int j = 1; j <= t; j++) scr[i] += ac[i][j] * pt[j];
for (int i = 1; i <= n; i++) rk[i] = i;
sort(rk + 1, rk + n + 1, [](int x, int y) -> bool {
if (scr[x] != scr[y]) return scr[x] > scr[y];
if (cnt[x] != cnt[y]) return cnt[x] > cnt[y];
return x < y;
});
cout << scr[p] << " ";
for (int i = 1; i <= n; i++) if (rk[i] == p) cout << i << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |