Submission #860795

#TimeUsernameProblemLanguageResultExecution timeMemory
860795Kak008723Poi (IOI09_poi)C++14
0 / 100
211 ms12116 KiB
#include<bits/stdc++.h> using namespace std; int n,m,k,b[2005],c[2005]; bool a[2005][2005]; int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>n>>m>>k; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin>>a[i][j]; } } for(int i=1;i<=m;i++){ int ans = 0; for(int j=1;j<=n;j++){ ans+=a[j][i]; } ans=n-ans; b[i]=ans; } int now = 0 ; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ c[i]+=a[i][j]*b[j]; } if(i==k) now = c[k]; } //for(int i=1;i<=n;i++) cout<<c[i]<<' '; sort(c+1,c+1+n); auto it = lower_bound(c+1,c+1+n,now); cout<<c[k]<<' '<<*it-1; }
#Verdict Execution timeMemoryGrader output
Fetching results...