# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
753769 |
2023-06-06T01:16:45 Z |
vjudge1 |
Poi (IOI09_poi) |
C++ |
|
576 ms |
17552 KB |
#include <bits/stdc++.h>
using namespace std;
bool comparator(pair <int, int> a, pair <int, int> b){
if(a.first==b.first&&a.second<b.second) return true;
return false;
}
int main(){
int n, t, p;
cin >> n >> t >> p;
int task[t+2];
vector <pair <int, int>> rank;
for(int i=0; i<n; i++){
for (int j = 1; j <= t; ++j){
int x;
cin >> x;
if(x==0) task[j]++;
if(x==1) rank.push_back(make_pair(j, i));
}
}
vector <pair <int, int>> final(n+2);
for (int i = 0; i < rank.size(); ++i){
final[rank[i].second].first+=task[rank[i].first];
final[rank[i].second].second=rank[i].second;
}
sort(final.rbegin(), final.rend(), comparator);
for (int i = 1; i <= t; ++i){
if(final[i].second==p-1){
cout << final[i].first << " " << i+1 << endl;
}
}
}
Compilation message
poi.cpp: In function 'int main()':
poi.cpp:21:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
21 | for (int i = 0; i < rank.size(); ++i){
| ~~^~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
300 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
296 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
296 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
9 |
Incorrect |
3 ms |
340 KB |
Output isn't correct |
10 |
Incorrect |
5 ms |
596 KB |
Output isn't correct |
11 |
Incorrect |
19 ms |
1104 KB |
Output isn't correct |
12 |
Incorrect |
30 ms |
1748 KB |
Output isn't correct |
13 |
Incorrect |
86 ms |
4860 KB |
Output isn't correct |
14 |
Incorrect |
119 ms |
4884 KB |
Output isn't correct |
15 |
Incorrect |
219 ms |
8900 KB |
Output isn't correct |
16 |
Incorrect |
232 ms |
9080 KB |
Output isn't correct |
17 |
Incorrect |
351 ms |
17328 KB |
Output isn't correct |
18 |
Incorrect |
398 ms |
17424 KB |
Output isn't correct |
19 |
Incorrect |
558 ms |
17548 KB |
Output isn't correct |
20 |
Incorrect |
576 ms |
17552 KB |
Output isn't correct |