# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
632240 |
2022-08-19T18:20:39 Z |
device |
Poi (IOI09_poi) |
C++17 |
|
0 ms |
0 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;
}
void solve(int testcase){
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";
}
}
Compilation message
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status