제출 #415277

#제출 시각아이디문제언어결과실행 시간메모리
415277AntekbPoi (IOI09_poi)C++14
100 / 100
753 ms16008 KiB
#include<bits/stdc++.h> #define st first #define nd second using namespace std; const int N=2005; int tab[N][N]; int sco[N]; int main(){ int n, m, t; cin>>n>>m>>t; for(int i=0; i<n; i++){ for(int j=0; j<m; j++){ cin>>tab[i][j]; sco[j]+=1-tab[i][j]; } } vector<pair<pair<int, int>, int> > V; int ans=0; for(int i=0; i<n; i++){ int k=0, l=0; for(int j=0; j<m; j++){ k+=sco[j]*tab[i][j]; l+=tab[i][j]; } if(i==t-1)ans=k; V.push_back({{k, l}, -i}); } sort(V.begin(), V.end()); //reverse(V.begin(), V.end()); cout<<ans<<" "; for(int i=0; i<n; i++)if(V[i].nd==1-t){ cout<<n-i; break; } }
#Verdict Execution timeMemoryGrader output
Fetching results...