# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
307590 |
2020-09-28T18:50:55 Z |
sofapuden |
Poi (IOI09_poi) |
C++14 |
|
1103 ms |
24668 KB |
#include <bits/stdc++.h>
using namespace std;
bool comp(pair<pair<int,int>,int> a, pair<pair<int,int>,int> b){
if(a.first.first == b.first.first){
if(a.first.second == b.first.second){
return a.second < b.second;
}
return a.first.second > b.first.second;
}
return a.first.first > b.first.first;
}
int main(){
int n, t, p; cin >> n >> t >> p;
vector<int> points(n,0);
vector<vector<int>> ans(n, vector<int> (t));
for(auto &x : ans)for(auto &y : x)cin >> y;
for(int i = 0; i < n; ++i){
for(int j = 0; j < t; ++j){
points[j]+=!ans[i][j];
}
}
vector<pair<pair<int,int>,int>> order;
for(int i = 0; i < n; ++i){
int cn = 0;
int po = 0;
for(int j = 0; j < t; ++j){
cn+=ans[i][j];
po+=ans[i][j]*points[j];
}
order.push_back({{po,cn},i});
}
sort(order.begin(),order.end(), comp);
for(int i = 0; i < n; ++i){
if(order[i].second == p-1){
cout << order[i].first.first << " " << i+1 << "\n";
return 0;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Runtime error |
1 ms |
384 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
4 |
Correct |
1 ms |
256 KB |
Output is correct |
5 |
Runtime error |
4 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
6 |
Correct |
1 ms |
384 KB |
Output is correct |
7 |
Runtime error |
4 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
8 |
Correct |
2 ms |
384 KB |
Output is correct |
9 |
Runtime error |
7 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
10 |
Correct |
9 ms |
512 KB |
Output is correct |
11 |
Runtime error |
36 ms |
2040 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
12 |
Correct |
54 ms |
1536 KB |
Output is correct |
13 |
Runtime error |
166 ms |
6520 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
14 |
Correct |
230 ms |
5496 KB |
Output is correct |
15 |
Runtime error |
410 ms |
15736 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
16 |
Correct |
455 ms |
10100 KB |
Output is correct |
17 |
Runtime error |
669 ms |
24668 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
18 |
Correct |
743 ms |
16460 KB |
Output is correct |
19 |
Correct |
979 ms |
21752 KB |
Output is correct |
20 |
Correct |
1103 ms |
23928 KB |
Output is correct |