Submission #989798

#TimeUsernameProblemLanguageResultExecution timeMemory
989798aaaaaarrozPoi (IOI09_poi)C++17
100 / 100
332 ms24052 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n,t,p; cin>>n>>t>>p; p--; vector<vector<int>>puntaje(n,vector<int>(3,0)); vector<vector<int>>solved(n,vector<int>(t)); vector<int>accepted(t,0); for(int i=0;i<n;i++){ puntaje[i][2]=(n-i); for(int j=0;j<t;j++){ cin>>solved[i][j]; puntaje[i][1]+=solved[i][j]; if(solved[i][j]){ accepted[j]++; } } } for(int i=0;i<n;i++){ for(int j=0;j<t;j++){ puntaje[i][0]+=(solved[i][j]*(n-accepted[j])); } } sort(puntaje.rbegin(),puntaje.rend()); int pos; for(pos=0;pos<n;pos++){ if((n-puntaje[pos][2])==p){ break; } } cout<<puntaje[pos][0]<<" "<<pos+1<<"\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...