# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
632241 |
2022-08-19T18:21:11 Z |
device |
Poi (IOI09_poi) |
C++17 |
|
617 ms |
18820 KB |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
bool cmp(pair<int,pair<int,int>> a, pair<int,pair<int,int>> b){
if(a.ss.ff != b.ss.ff) return a.ss.ff > b.ss.ff;
else if(a.ss.ss != b.ss.ss) return a.ss.ss > b.ss.ss;
else return a.ff < b.ff;
}
int main(){
int n,t,p; cin >> n >> t >> p;
pair<int,int> par[n+1];
vector<int> psolved[t+1];
int tsolved[t+1] = {};
for(int i = 1; i <= n; i++) par[i] = {0,0};
for(int i = 1; i <= n; i++){
for(int j = 1; j <= t; j++){
int cmd; cin >> cmd;
if(cmd){
psolved[j].pb(i);
tsolved[j]++;
par[i].ss++;
}
}
}
for(int i = 1; i <= t; i++){
for(int nxt:psolved[i]){
par[nxt].ff += n-tsolved[i];
}
}
vector<pair<int,pair<int,int>>> v;
for(int i = 1; i <= n; i++){
v.pb({i,par[i]});
}
sort(v.begin(),v.end(),cmp);
for(int i = 0; i < n; i++){
if(v[i].ff == p) cout << v[i].ss.ff << " " << i+1 << "\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
304 KB |
Output is correct |
4 |
Correct |
0 ms |
304 KB |
Output is correct |
5 |
Correct |
1 ms |
296 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
340 KB |
Output is correct |
8 |
Correct |
2 ms |
308 KB |
Output is correct |
9 |
Correct |
3 ms |
312 KB |
Output is correct |
10 |
Correct |
4 ms |
396 KB |
Output is correct |
11 |
Correct |
21 ms |
916 KB |
Output is correct |
12 |
Correct |
28 ms |
1300 KB |
Output is correct |
13 |
Correct |
84 ms |
3412 KB |
Output is correct |
14 |
Correct |
116 ms |
4400 KB |
Output is correct |
15 |
Correct |
212 ms |
8752 KB |
Output is correct |
16 |
Correct |
263 ms |
9088 KB |
Output is correct |
17 |
Correct |
339 ms |
12088 KB |
Output is correct |
18 |
Correct |
391 ms |
12720 KB |
Output is correct |
19 |
Correct |
493 ms |
16684 KB |
Output is correct |
20 |
Correct |
617 ms |
18820 KB |
Output is correct |