# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
771901 |
2023-07-03T11:36:11 Z |
BlockOG |
Poi (IOI09_poi) |
C++14 |
|
468 ms |
15968 KB |
#include <iostream>
using namespace std;
/*
5 3 2
0 0 1
1 1 0
1 0 0
1 1 0
1 1 0
*/
int solved[2000][2000];
int amt_solved[2000];
int not_solved[2000];
int score[2000];
int main() {
int n, t, p; cin >> n >> t >> p; p--;
for (int i = 0; i < n; i++) {
for (int j = 0; j < t; j++) {
cin >> solved[i][j];
if (solved[i][j]) amt_solved[i]++;
else not_solved[j]++;
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < t; j++) {
if (solved[i][j]) score[i] += not_solved[j];
}
}
int place = 1;
for (int i = 0; i < n; i++) {
if (i == p) continue;
if (score[i] > score[p]) place++;
else if (score[i] == score[p]) {
if (amt_solved[i] > amt_solved[p]) place++;
else if (amt_solved[i] == amt_solved[p])
if (i < p) place++;
}
}
cout << score[p] << ' ' << place << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
468 KB |
Output is correct |
7 |
Correct |
1 ms |
596 KB |
Output is correct |
8 |
Correct |
2 ms |
596 KB |
Output is correct |
9 |
Correct |
2 ms |
724 KB |
Output is correct |
10 |
Correct |
4 ms |
1236 KB |
Output is correct |
11 |
Correct |
14 ms |
1852 KB |
Output is correct |
12 |
Correct |
23 ms |
3020 KB |
Output is correct |
13 |
Correct |
85 ms |
5316 KB |
Output is correct |
14 |
Correct |
101 ms |
7608 KB |
Output is correct |
15 |
Correct |
179 ms |
9696 KB |
Output is correct |
16 |
Correct |
184 ms |
10428 KB |
Output is correct |
17 |
Correct |
295 ms |
11992 KB |
Output is correct |
18 |
Correct |
309 ms |
13604 KB |
Output is correct |
19 |
Correct |
403 ms |
15948 KB |
Output is correct |
20 |
Correct |
468 ms |
15968 KB |
Output is correct |