# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
609864 | ozed | Poi (IOI09_poi) | C++14 | 617 ms | 23876 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;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
struct competition{
int score;
int solved;
int id;
};
bool compare(competition &t1,competition &t2){
if(t1.score > t2.score){return true;}
else if(t1.score<t2.score){return false;}
else if(t1.solved >t2.solved){return true;}
else if(t1.solved <t2.solved){return false;}
else return t1.id <t2.id;
}
int main(){
int n,t,p;
cin>>n>>t>>p;
vector<competition>v(n);
vector<vi>v1(n);
vi score(t);
for(int i=0;i<n;i++){
v1[i]=vi(t);
v[i].id=i+1;
for(int j=0;j<t;j++){
cin>>v1[i][j];
v[i].solved+=v1[i][j];
if(v1[i][j] == 0){
score[j]++;
}
}
}
for(int i=0;i<n;i++){
for(int j=0;j<t;j++){
if(v1[i][j]==1){
v[i].score+=score[j];
}
}
}
sort(v.begin(),v.end(),&compare);
for(int i=0;i<n;i++){
if(v[i].id==p){
cout<<v[i].score<<" "<<i+1<<endl;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |