# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
432518 | rainboy | Poi (IOI09_poi) | C11 | 493 ms | 15928 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 <stdio.h>
#define N 2000
#define T 2000
int main() {
static int aa[N][T], kk[T], ss[N], tt[N];
int n, t, p, i, j, rank;
scanf("%d%d%d", &n, &t, &p), p--;
for (i = 0; i < n; i++)
for (j = 0; j < t; j++) {
scanf("%d", &aa[i][j]);
if (aa[i][j])
kk[j]++;
}
for (i = 0; i < n; i++)
for (j = 0; j < t; j++)
if (aa[i][j])
ss[i] += n - kk[j], tt[i]++;
rank = 0;
for (i = 0; i < n; i++)
if (ss[i] > ss[p] || ss[i] == ss[p] && (tt[i] > tt[p] || tt[i] == tt[p] && i <= p))
rank++;
printf("%d %d\n", ss[p], rank);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |