# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
933634 |
2024-02-26T02:45:56 Z |
Neytrino |
Poi (IOI09_poi) |
C++14 |
|
193 ms |
23860 KB |
/**
* author: inastranets
* created: 26.02.2024 05:31:30
**/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, t, p;
cin >> n >> t >> p;
vector<vector<int>> solved(n, vector<int>(t, 0));
vector<int> points(t, 0);
for (int i = 0; i < n; ++ i) {
for (int j = 0; j < t; ++ j) {
cin >> solved[i][j];
points[j] += (solved[i][j] == 0);
}
}
vector<pair<int,int> > score;
for (int i = 0; i < n; ++ i) {
int result = 0;
for (int j = 0; j < t; ++ j) {
if (solved[i][j]) {
result += points[j];
}
}
score.push_back({result, i + 1});
}
sort(score.begin(), score.end(), [](const pair<int,int>& a, const pair<int,int>& b) {
if (a.first == b.first) {
return a.second < b.second;
}
return a.first < b.first;
});
for (int i = 0; i < n; ++ i) {
auto [rank, id] = score[i];
if (id == p) {
cout << rank << ' ' << i + 1;
break;
}
}
return 0;
}
Compilation message
poi.cpp: In function 'int main()':
poi.cpp:47:11: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
47 | auto [rank, id] = score[i];
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
604 KB |
Output isn't correct |
11 |
Incorrect |
8 ms |
1116 KB |
Output isn't correct |
12 |
Incorrect |
10 ms |
1628 KB |
Output isn't correct |
13 |
Incorrect |
29 ms |
3800 KB |
Output isn't correct |
14 |
Incorrect |
41 ms |
5456 KB |
Output isn't correct |
15 |
Incorrect |
72 ms |
9276 KB |
Output isn't correct |
16 |
Incorrect |
79 ms |
9808 KB |
Output isn't correct |
17 |
Incorrect |
117 ms |
14744 KB |
Output isn't correct |
18 |
Incorrect |
131 ms |
16468 KB |
Output isn't correct |
19 |
Incorrect |
171 ms |
21504 KB |
Output isn't correct |
20 |
Incorrect |
193 ms |
23860 KB |
Output isn't correct |