#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int status[N][N], task_score[N];
pair<int, int> contestant[N];
bool cmp(pair<int, int> a, pair<int, int> b) {
if (a.first != b.first) return a.first > b.first;
return a.second < b.second;
}
int main() {
int n, t, p;
cin >> n >> t >> p;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= t; j++) cin >> status[i][j];
}
for (int j = 1; j <= t; j++) {
for (int i = 1; i <= n; i++) task_score[j] += (status[i][j] == 0);
}
for (int i = 1; i <= n; i++) {
contestant[i].first = 0;
contestant[i].second = i;
for (int j = 1; j <= t; j++) {
if (status[i][j]) contestant[i].first += task_score[j];
}
}
sort(contestant + 1, contestant + n + 1, cmp);
for (int i = 1; i <= n; i++) {
if (contestant[i].second == p) {
cout << contestant[i].first << ' ' << contestant[i].second << '\n';
return 0;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
512 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
640 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
640 KB |
Output isn't correct |
9 |
Incorrect |
5 ms |
768 KB |
Output isn't correct |
10 |
Incorrect |
9 ms |
1280 KB |
Output isn't correct |
11 |
Incorrect |
34 ms |
2040 KB |
Output isn't correct |
12 |
Incorrect |
57 ms |
3064 KB |
Output isn't correct |
13 |
Incorrect |
168 ms |
5496 KB |
Output isn't correct |
14 |
Incorrect |
237 ms |
7672 KB |
Output isn't correct |
15 |
Incorrect |
426 ms |
9720 KB |
Output isn't correct |
16 |
Incorrect |
464 ms |
10488 KB |
Output isn't correct |
17 |
Incorrect |
686 ms |
12128 KB |
Output isn't correct |
18 |
Incorrect |
764 ms |
13816 KB |
Output isn't correct |
19 |
Incorrect |
1028 ms |
16120 KB |
Output isn't correct |
20 |
Incorrect |
1122 ms |
16244 KB |
Output isn't correct |