# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
522266 |
2022-02-04T11:18:34 Z |
new_acc |
Poi (IOI09_poi) |
C++14 |
|
223 ms |
28156 KB |
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(a, b) for(int a = 0; a < (int)(b); a++)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int N=5e5+10;
pair<int,int>t[N];
int ile[N],zr[N];
vi xd[N];
void solve(){
int n,m,p;
cin>>n>>m>>p;
p--;
rep(i,n){
rep(j,m){
int a;
cin>>a;
ile[j]+=!a;
xd[i].push_back(a);
}
}
rep(i,n){
rep(j,m) if(xd[i][j]==1) t[i].fi+=ile[j],zr[i]++;
t[i].se=i;
}
sort(t,t+n,[](pair<int,int> a,pair<int,int> b){
if(a.fi==b.fi){
if(zr[a.se]==zr[b.se]) return a.se<b.se;
return zr[a.se]>zr[b.se];
}
return a.fi>b.fi;
});
rep(i,n) if(t[i].se==p) cout<<t[i].fi<<" "<<i+1<<"\n";
}
int main(){
ios_base::sync_with_stdio(0),cin.tie(0);
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11980 KB |
Output is correct |
2 |
Correct |
6 ms |
11980 KB |
Output is correct |
3 |
Correct |
6 ms |
11980 KB |
Output is correct |
4 |
Correct |
6 ms |
11980 KB |
Output is correct |
5 |
Correct |
7 ms |
11980 KB |
Output is correct |
6 |
Correct |
7 ms |
11980 KB |
Output is correct |
7 |
Correct |
8 ms |
12108 KB |
Output is correct |
8 |
Correct |
6 ms |
12108 KB |
Output is correct |
9 |
Correct |
7 ms |
12108 KB |
Output is correct |
10 |
Correct |
10 ms |
12204 KB |
Output is correct |
11 |
Correct |
17 ms |
12620 KB |
Output is correct |
12 |
Correct |
18 ms |
12972 KB |
Output is correct |
13 |
Correct |
40 ms |
14800 KB |
Output is correct |
14 |
Correct |
54 ms |
16068 KB |
Output is correct |
15 |
Correct |
93 ms |
21700 KB |
Output is correct |
16 |
Correct |
97 ms |
22452 KB |
Output is correct |
17 |
Correct |
142 ms |
24016 KB |
Output is correct |
18 |
Correct |
170 ms |
25644 KB |
Output is correct |
19 |
Correct |
210 ms |
28156 KB |
Output is correct |
20 |
Correct |
223 ms |
28120 KB |
Output is correct |