Submission #1031588

#TimeUsernameProblemLanguageResultExecution timeMemory
1031588ezzzayPoi (IOI09_poi)C++14
100 / 100
365 ms39760 KiB
#include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back const int N=3e3; #define int long long 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,pair<int,int>>>v; for(int i=1;i<=n;i++){ int s=0; int h=0; for(int j=1;j<=m;j++){ if(a[i][j]){ s+=pnt[j]; h++; } } v.pb({-s,{-h,i}}); } sort(v.begin(),v.end()); for(int i=0;i<n;i++){ if(v[i].ss.ss==p){ cout<<v[i].ff*-1<<" "<<i+1; return 0; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...