Submission #1031586

#TimeUsernameProblemLanguageResultExecution timeMemory
1031586ezzzayPoi (IOI09_poi)C++14
70 / 100
343 ms31572 KiB
#include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back const int N=3e3; int a[N][N]; int pnt[N]; signed main(){ int n,m,p; cin>>n>>m>>p; for(int i=1;i<=m;i++){ pnt[i]=0; } for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin>>a[i][j]; if(!a[i][j])pnt[j]++; } } vector<pair<int,int>>v; for(int i=1;i<=n;i++){ int s=0; for(int j=1;j<=m;j++){ if(a[i][j]){ s+=pnt[j]; } } v.pb({-s,i}); } sort(v.begin(),v.end()); for(int i=0;i<n;i++){ if(v[i].ss==p){ cout<<v[i].ff*-1<<" "<<i+1; return 0; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...