# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
489560 |
2021-11-23T08:43:11 Z |
shauryatuli9 |
Poi (IOI09_poi) |
C++14 |
|
642 ms |
19060 KB |
#include <bits/stdc++.h>
using namespace std;
// globals
vector<int> probSolv, solPerProb, points;
bool comp(int i, int j) {
if (points[i] > points[j])
return true;
else if (points[i] < points[j])
return false;
else if (probSolv[i] > probSolv[j])
return true;
else if (probSolv[i] < probSolv[j])
return false;
else
return (i > j);
}
void sortPlayers(vector<vector<int>>& table, vector<int>& players) {
int T = (int)table[0].size(),
N = (int)table.size(); // this could have been players.size() as well
for (int i = 0; i < T; i++) {
for (int j = 0; j < N; j++)
if (table[j][i]) solPerProb[i]++;
}
for (int i = 0; i < N; i++) {
for (int j = 0; j < T; j++) {
if (table[i][j]) {
points[i] += (N - solPerProb[j]);
probSolv[i]++;
}
}
}
sort(players.begin(), players.end(), comp);
}
int main() {
int N, T, P;
cin >> N >> T >> P;
vector<vector<int>> table(N, vector<int>(T)); // N x T table;
vector<int> players(N);
probSolv.assign(N, 0);
solPerProb.assign(T, 0);
points.assign(N, 0);
for (int i = 0; i < N; i++) {
players[i] = i; // assigning ids
for (int j = 0; j < T; j++) cin >> table[i][j];
}
sortPlayers(table, players);
for (int i = 0; i < N; i++) {
if (players[i] == P - 1) {
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
292 KB |
Output isn't correct |
9 |
Incorrect |
4 ms |
332 KB |
Output isn't correct |
10 |
Incorrect |
6 ms |
460 KB |
Output isn't correct |
11 |
Incorrect |
27 ms |
972 KB |
Output isn't correct |
12 |
Incorrect |
37 ms |
1484 KB |
Output isn't correct |
13 |
Incorrect |
82 ms |
3768 KB |
Output isn't correct |
14 |
Incorrect |
125 ms |
5032 KB |
Output isn't correct |
15 |
Incorrect |
266 ms |
8844 KB |
Output isn't correct |
16 |
Incorrect |
243 ms |
9468 KB |
Output isn't correct |
17 |
Incorrect |
377 ms |
12764 KB |
Output isn't correct |
18 |
Incorrect |
416 ms |
14028 KB |
Output isn't correct |
19 |
Incorrect |
563 ms |
17496 KB |
Output isn't correct |
20 |
Incorrect |
642 ms |
19060 KB |
Output isn't correct |