# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
307592 |
2020-09-28T19:00:14 Z |
sofapuden |
Poi (IOI09_poi) |
C++14 |
|
1071 ms |
31896 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool comp(pair<pair<ll,ll>,ll> a, pair<pair<ll,ll>,ll> 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(){
ll n, t, p; cin >> n >> t >> p;
vector<ll> points(t,0);
vector<vector<ll>> ans(n, vector<ll> (t));
for(auto &x : ans)for(auto &y : x)cin >> y;
for(ll i = 0; i < n; ++i){
for(ll j = 0; j < t; ++j){
points[j]+=!ans[i][j];
}
}
vector<pair<pair<ll,ll>,ll>> order;
for(ll i = 0; i < n; ++i){
ll cn = 0;
ll po = 0;
for(ll 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(ll 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 |
0 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
256 KB |
Output is correct |
4 |
Correct |
0 ms |
256 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
384 KB |
Output is correct |
7 |
Correct |
2 ms |
384 KB |
Output is correct |
8 |
Correct |
2 ms |
384 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
9 ms |
512 KB |
Output is correct |
11 |
Correct |
33 ms |
1280 KB |
Output is correct |
12 |
Correct |
54 ms |
1920 KB |
Output is correct |
13 |
Correct |
159 ms |
4992 KB |
Output is correct |
14 |
Correct |
234 ms |
7160 KB |
Output is correct |
15 |
Correct |
401 ms |
12160 KB |
Output is correct |
16 |
Correct |
438 ms |
13176 KB |
Output is correct |
17 |
Correct |
646 ms |
19228 KB |
Output is correct |
18 |
Correct |
727 ms |
21752 KB |
Output is correct |
19 |
Correct |
963 ms |
28664 KB |
Output is correct |
20 |
Correct |
1071 ms |
31896 KB |
Output is correct |