# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
753775 |
2023-06-06T01:55:06 Z |
vjudge1 |
Poi (IOI09_poi) |
C++ |
|
577 ms |
17340 KB |
#include <bits/stdc++.h>
using namespace std;
bool comparator(pair <pair<int, int>, int> a, pair <pair<int, int>, int> b){
if(a.first.first>b.first.first) return true;
if(a.first.first==b.first.first&&a.second>b.second) return true;
if(a.first.first==b.first.first&&a.second==b.second && a.first.second<b.first.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 <pair <int, int>, int>> final(n);
for (int i = 0; i < rank.size(); ++i){
final[rank[i].second].first.first+=task[rank[i].first];
final[rank[i].second].first.second=rank[i].second;
final[rank[i].second].second++;
}
sort(final.begin(), final.end(), comparator);
for (int i = 0; i < n; ++i){
if(final[i].first.second==p-1){
cout << final[i].first.first << " " << i+1 << endl;
}
}
}
Compilation message
poi.cpp: In function 'int main()':
poi.cpp:23: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]
23 | for (int i = 0; i < rank.size(); ++i){
| ~~^~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
300 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
296 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
296 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
308 KB |
Output isn't correct |
8 |
Incorrect |
2 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 |
22 ms |
1136 KB |
Output isn't correct |
12 |
Incorrect |
33 ms |
1636 KB |
Output isn't correct |
13 |
Incorrect |
89 ms |
4968 KB |
Output isn't correct |
14 |
Incorrect |
129 ms |
4792 KB |
Output isn't correct |
15 |
Incorrect |
224 ms |
9036 KB |
Output isn't correct |
16 |
Incorrect |
259 ms |
9072 KB |
Output isn't correct |
17 |
Incorrect |
348 ms |
17272 KB |
Output isn't correct |
18 |
Incorrect |
401 ms |
17340 KB |
Output isn't correct |
19 |
Incorrect |
502 ms |
17336 KB |
Output isn't correct |
20 |
Incorrect |
577 ms |
17312 KB |
Output isn't correct |