# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
989798 | aaaaaarroz | Poi (IOI09_poi) | C++17 | 332 ms | 24052 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |