# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
304398 | dolijan | Poi (IOI09_poi) | C++14 | 1136 ms | 12252 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;
struct skor{
public:
int poeni,br,rb;
};
bool comp(skor a,skor b)
{
if(a.poeni<b.poeni) return true;
else if(a.poeni==b.poeni)
{
if(a.br<b.br) return true;
else if(a.br==b.br)
{
if(a.rb<b.rb) return true;
}
}
return false;
}
int main()
{
int n,t,p;
cin>>n>>t>>p;
int resen[t];
for(int i=0;i<t;i++) resen[i]=0;
bool li[n][t];
for(int i=0;i<n;i++)
{
for(int j=0;j<t;j++)
{
cin>>li[i][j];
resen[j]+=li[i][j];
}
}
skor takm[n];
skor pom;
for(int i=0;i<n;i++)
{
pom.poeni=0;
pom.br=0;
pom.rb=i;
for(int j=0;j<t;j++)
{
if(li[i][j])
{
pom.poeni+=(n-resen[j]);
pom.br++;
}
}
takm[i]=pom;
}
sort(takm,takm+n,comp);
for(int i=0;i<n;i++)
{
if(takm[i].rb==p-1)
{
cout<<takm[i].poeni<<" "<<i+1<<endl;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |