# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
789167 | irmuun | Poi (IOI09_poi) | C++17 | 191 ms | 23788 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;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
bool compare(tuple<int,int,int>a,tuple<int,int,int>b){
if(get<0>(a)>get<0>(b)){
return true;
}
if(get<0>(a)<get<0>(b)){
return false;
}
if(get<1>(a)>get<1>(b)){
return true;
}
if(get<1>(a)<get<1>(b)){
return false;
}
return get<2>(a)<get<2>(b);
}
int main(){
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n,t,p;
cin>>n>>t>>p;
int a[n+1][t+1];
tuple<int,int,int>point[n+1];
int score[t+1];
fill(score,score+t+1,0);
for(int i=1;i<=n;i++){
for(int j=1;j<=t;j++){
cin>>a[i][j];
score[j]+=(1-a[i][j]);
}
}
for(int i=1;i<=n;i++){
get<2>(point[i])=i;
for(int j=1;j<=t;j++){
if(a[i][j]==1){
get<1>(point[i])++;
get<0>(point[i])+=score[j];
}
}
}
sort(point+1,point+n+1,compare);
for(int i=1;i<=n;i++){
if(get<2>(point[i])==p){
cout<<get<0>(point[i])<<' '<<i;
return 0;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |