Submission #1020083

#TimeUsernameProblemLanguageResultExecution timeMemory
1020083AliHasanliPoi (IOI09_poi)C++17
0 / 100
368 ms12112 KiB
#include<bits/stdc++.h> using namespace std; int main() { int n,t,P; cin>>n>>t>>P; int cnt[t]; bool a[n][t]; for(int i=0;i<t;i++)cnt[i]=0; pair<int,pair<int,int>>p[n]; for(int i=0;i<n;i++) { p[i].second.second=i+1; p[i].second.first=0; for(int j=0;j<t;j++) { cin>>a[i][j]; if(!a[i][j])cnt[j]++; else p[i].second.first++; } } for(int i=0;i<n;i++) for(int j=0;j<t;j++) p[i].first+=cnt[j]*a[i][j]; sort(p,p+n); for(int i=n-1;i>=0;i--) if(p[i].second.second==P) cout<<p[i].first<<" "<<i+1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...