# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
753751 |
2023-06-05T21:52:10 Z |
vjudge1 |
Poi (IOI09_poi) |
C++17 |
|
200 ms |
8116 KB |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef long long ll;
typedef unsigned long long ull;
bool comparator(pair<int, pair<int, int>>& a, pair<int, pair<int, int>>& b) {
if(a.se.se != b.se.se) return a.se.se > b.se.se;
else return a.fi < b.fi;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n, t, p;
cin >> n >> t >> p;
vector <pair<int, pair<int, int>>> data(t); // id (skor, sum)
for(auto element : data) {
element.se.se = 0;
}
for(int i=0; i<t; i++) {
data[i].fi = i;
}
for(int i=0; i<n; i++) {
for(int j=0; j<t; j++) {
cin >> data[j].se.fi;
data[j].se.se += data[j].se.fi;
}
}
sort(data.begin(), data.end(), comparator);
int rank, score;
for(int i=0; i<t; i++) {
if(data[i].fi+1 == p) {
score = data[i].se.se;
rank = i+1;
break;
}
}
cout << score << " " << rank;
}
Compilation message
poi.cpp: In function 'int main()':
poi.cpp:21:14: warning: variable 'element' set but not used [-Wunused-but-set-variable]
21 | for(auto element : data) {
| ^~~~~~~
poi.cpp:46:22: warning: 'score' may be used uninitialized in this function [-Wmaybe-uninitialized]
46 | cout << score << " " << rank;
| ^~~
poi.cpp:46:29: warning: 'rank' may be used uninitialized in this function [-Wmaybe-uninitialized]
46 | cout << score << " " << rank;
| ^~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
320 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
328 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
324 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
340 KB |
Output isn't correct |
11 |
Incorrect |
7 ms |
468 KB |
Output isn't correct |
12 |
Incorrect |
10 ms |
596 KB |
Output isn't correct |
13 |
Incorrect |
29 ms |
1456 KB |
Output isn't correct |
14 |
Incorrect |
47 ms |
1964 KB |
Output isn't correct |
15 |
Incorrect |
81 ms |
3244 KB |
Output isn't correct |
16 |
Incorrect |
91 ms |
3384 KB |
Output isn't correct |
17 |
Incorrect |
116 ms |
4908 KB |
Output isn't correct |
18 |
Incorrect |
136 ms |
5560 KB |
Output isn't correct |
19 |
Incorrect |
180 ms |
7352 KB |
Output isn't correct |
20 |
Incorrect |
200 ms |
8116 KB |
Output isn't correct |