# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
526102 | Deepesson | Poi (IOI09_poi) | C++17 | 543 ms | 15936 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>
typedef std::pair<int,int> pii;
typedef std::pair<pii,int> ppi;
bool sortar(ppi a,ppi b){
if(a.first.first!=b.first.first){
return a>b;
}else {
if(a.first.second!=b.first.second){
return a>b;
}else return a<b;
}
}
int main()
{
int N,T,P;
std::cin>>N>>T>>P;
int pontos[T]={};
int resolveu[N]={};
int tab[N][T];
for(int i=0;i!=N;++i){
for(int j=0;j!=T;++j){
int x;
std::cin>>x;
tab[i][j]=x;
if(!x)pontos[j]++;else resolveu[i]++;
}
}
int score[N]={};
for(int i=0;i!=N;++i){
for(int j=0;j!=T;++j){
if(tab[i][j])score[i]+=pontos[j];
}
}
std::cout<<score[P-1]<<" ";
std::vector<ppi> geral;
for(int i=0;i!=N;++i){
geral.push_back({{score[i],resolveu[i]},i});
}
std::sort(geral.begin(),geral.end(),sortar);
for(int i=0;i!=geral.size();++i){
if(geral[i].second==P-1){
std::cout<<(i+1)<<"\n";
return 0;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |