#include <bits/stdc++.h>
typedef long long ll;
#define M 1000000007
#define N (1 << 18)
using namespace std;
int score[2001];
vector<int> solved[2001];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, t, p;
cin >> n >> t >> p;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= t; ++j) {
int x;
cin >> x;
if (x == 0) score[j]++;
else solved[i].push_back(j);
}
}
vector<pair<int, int>> v;
for (int i = 1; i <= n; ++i) {
int sc = 0;
for (int x : solved[i]) sc += score[x];
v.push_back({sc, i});
}
sort(v.rbegin(), v.rend());
for (int i = 0; i < n; ++i) {
if (v[i].second == p) {
cout << v[i].first << " " << i + 1 << "\n";
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
7 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
8 |
Correct |
1 ms |
340 KB |
Output is correct |
9 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
10 |
Correct |
2 ms |
468 KB |
Output is correct |
11 |
Correct |
7 ms |
596 KB |
Output is correct |
12 |
Incorrect |
11 ms |
836 KB |
Output isn't correct |
13 |
Incorrect |
30 ms |
1740 KB |
Output isn't correct |
14 |
Incorrect |
46 ms |
2388 KB |
Output isn't correct |
15 |
Correct |
79 ms |
5196 KB |
Output is correct |
16 |
Correct |
104 ms |
5528 KB |
Output is correct |
17 |
Correct |
119 ms |
6400 KB |
Output is correct |
18 |
Correct |
136 ms |
7116 KB |
Output is correct |
19 |
Incorrect |
215 ms |
8324 KB |
Output isn't correct |
20 |
Correct |
203 ms |
9608 KB |
Output is correct |