Submission #1020084

#TimeUsernameProblemLanguageResultExecution timeMemory
1020084AliHasanliPoi (IOI09_poi)C++17
100 / 100
363 ms11860 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; p[i].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<<" "<<n-i; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...