# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
384816 |
2021-04-02T10:58:59 Z |
ritul_kr_singh |
Poi (IOI09_poi) |
C++17 |
|
350 ms |
12140 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define sp << ' ' <<
#define nl << '\n'
signed main(){
cin.tie(0)->sync_with_stdio(0);
int n, t, p; cin >> n >> t >> p;
bool g[n][t];
int points[t]; fill(points, points+t, n);
array<int, 3> ranks[n];
for(int i=0; i<n; ++i)
for(int j=0; j<t; ++j)
cin >> g[i][j], points[j] -= g[i][j];
for(int i=0; i<n; ++i){
int a = 0, b = 0;
for(int j=0; j<t; ++j) if(g[i][j]) a += points[j], ++b;
ranks[i] = {-a, -b, i};
}
sort(ranks, ranks+n);
for(int i=0; i<n; ++i){
if(ranks[i][2]==p-1) cout << -ranks[i][0] sp i+1;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
2 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
2 ms |
364 KB |
Output is correct |
10 |
Correct |
4 ms |
364 KB |
Output is correct |
11 |
Correct |
12 ms |
748 KB |
Output is correct |
12 |
Correct |
20 ms |
876 KB |
Output is correct |
13 |
Correct |
65 ms |
2036 KB |
Output is correct |
14 |
Correct |
75 ms |
2796 KB |
Output is correct |
15 |
Correct |
131 ms |
4760 KB |
Output is correct |
16 |
Correct |
148 ms |
5164 KB |
Output is correct |
17 |
Correct |
216 ms |
7404 KB |
Output is correct |
18 |
Correct |
248 ms |
8444 KB |
Output is correct |
19 |
Correct |
312 ms |
10988 KB |
Output is correct |
20 |
Correct |
350 ms |
12140 KB |
Output is correct |