# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
771889 |
2023-07-03T11:23:21 Z |
BlockOG |
Poi (IOI09_poi) |
C++14 |
|
484 ms |
16008 KB |
#include <iostream>
#include <algorithm>
#include <utility>
using namespace std;
/*
5 3 2
0 0 1
1 1 0
1 0 0
1 1 0
1 1 0
*/
struct Contestant {
int score, problems, id;
};
bool compare(Contestant a, Contestant b) {
if (a.score > b.score) return true;
if (a.score < b.score) return false;
if (a.problems > b.problems) return true;
if (a.problems < b.problems) return false;
return a.id < b.id;
}
int solved[2000][2000];
int not_solved[2000];
Contestant score[2000];
int main() {
int n, t, p; cin >> n >> t >> p; p--;
for (int i = 0; i < n; i++) {
score[i].id = i;
for (int j = 0; j < t; j++) {
cin >> solved[i][j];
if (solved[i][j]) score[i].problems++;
else not_solved[j]++;
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < t; j++) {
if (solved[i][j])
score[i].score += not_solved[j];
}
}
sort(score, score + n, compare);
for (int i = 0; i < n; i++) {
if (score[i].id == p) {
cout << i + 1 << endl;
break;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
340 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
468 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
596 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
596 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
724 KB |
Output isn't correct |
10 |
Incorrect |
4 ms |
1108 KB |
Output isn't correct |
11 |
Incorrect |
15 ms |
1924 KB |
Output isn't correct |
12 |
Incorrect |
26 ms |
3064 KB |
Output isn't correct |
13 |
Incorrect |
73 ms |
5312 KB |
Output isn't correct |
14 |
Incorrect |
104 ms |
7588 KB |
Output isn't correct |
15 |
Incorrect |
184 ms |
9608 KB |
Output isn't correct |
16 |
Incorrect |
197 ms |
10388 KB |
Output isn't correct |
17 |
Incorrect |
290 ms |
12032 KB |
Output isn't correct |
18 |
Incorrect |
332 ms |
13596 KB |
Output isn't correct |
19 |
Incorrect |
435 ms |
15856 KB |
Output isn't correct |
20 |
Incorrect |
484 ms |
16008 KB |
Output isn't correct |