# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
730142 | lucri | Poi (IOI09_poi) | C++17 | 575 ms | 11984 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;
bool a[2010][2010];
int n,t,p,sc[2010];
struct results{int code,solved,score;}v[2010];
bool comp(results a,results b)
{
if(a.score!=b.score) return a.score>b.score;
if(a.solved!=b.solved) return a.solved>b.solved;
return a.code<b.code;
}
int main()
{
cin>>n>>t>>p;
for(int i=1;i<=t;++i)
sc[i]=n;
for(int i=1;i<=n;++i)
{
v[i].code=i;
for(int j=1;j<=t;++j)
{
cin>>a[i][j];
v[i].solved+=a[i][j];
sc[j]-=a[i][j];
}
}
for(int i=1;i<=n;++i)
{
for(int j=1;j<=t;++j)
{
if(a[i][j])
v[i].score+=sc[j];
}
}
cout<<v[p].score<<' ';
sort(v+1,v+n+1,comp);
for(int i=1;i<=n;++i)
if(v[i].code==p)
cout<<i;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |