Submission #304398

#TimeUsernameProblemLanguageResultExecution timeMemory
304398dolijanPoi (IOI09_poi)C++14
0 / 100
1136 ms12252 KiB
#include <bits/stdc++.h> using namespace std; struct skor{ public: int poeni,br,rb; }; bool comp(skor a,skor b) { if(a.poeni<b.poeni) return true; else if(a.poeni==b.poeni) { if(a.br<b.br) return true; else if(a.br==b.br) { if(a.rb<b.rb) return true; } } return false; } int main() { int n,t,p; cin>>n>>t>>p; int resen[t]; for(int i=0;i<t;i++) resen[i]=0; bool li[n][t]; for(int i=0;i<n;i++) { for(int j=0;j<t;j++) { cin>>li[i][j]; resen[j]+=li[i][j]; } } skor takm[n]; skor pom; for(int i=0;i<n;i++) { pom.poeni=0; pom.br=0; pom.rb=i; for(int j=0;j<t;j++) { if(li[i][j]) { pom.poeni+=(n-resen[j]); pom.br++; } } takm[i]=pom; } sort(takm,takm+n,comp); for(int i=0;i<n;i++) { if(takm[i].rb==p-1) { cout<<takm[i].poeni<<" "<<i+1<<endl; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...