# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
393979 | Berted | Poi (IOI09_poi) | C++14 | 276 ms | 23812 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 <iostream>
using namespace std;
int N, M, K, B[2001][2001], cnt[2001], A[2001][2];
int main()
{
ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> N >> M >> K; K--;
for (int i = 0; i < N; i++)
{
for (int j = 0; j < M; j++)
{
cin >> B[i][j];
cnt[j] += !B[i][j];
}
}
for (int i = 0; i < N; i++)
{
for (int j = 0; j < M; j++) {A[i][0] += B[i][j] * cnt[j]; A[i][1] += B[i][j];}
}
int ans = 1;
for (int i = 0; i < N; i++)
{
if (i == K) continue;
ans += make_pair(A[i][0], make_pair(A[i][1], -i)) > make_pair(A[K][0], make_pair(A[K][1], -K));
}
cout << A[K][0] << " " << ans << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |