# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
236158 | nicolaalexandra | Poi (IOI09_poi) | C++14 | 858 ms | 24056 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.
/// pb asta e mai penala decat mn
#include <bits/stdc++.h>
#define DIM 2010
using namespace std;
struct idk{
int scor,cnt,poz;
} w[DIM];
int v[DIM],a[DIM][DIM];
int n,t,p,i,j;
inline int cmp (idk a, idk b){
if (a.scor == b.scor){
if (a.cnt == b.cnt)
return a.poz < b.poz;
return a.cnt > b.cnt;
}
return a.scor > b.scor;
}
int main (){
//ifstream cin ("date.in");
//ofstream cout ("date.out");
cin>>n>>t>>p;
for (i=1;i<=n;i++){
for (j=1;j<=t;j++){
cin>>a[i][j];
if (!a[i][j])
v[j]++;
}
}
for (i=1;i<=n;i++){
int sum = 0, cnt = 0;
for (j=1;j<=t;j++)
if (a[i][j]){
sum += v[j];
cnt++;
}
w[i] = {sum,cnt,i};
}
sort (w+1,w+n+1,cmp);
for (i=1;i<=n;i++)
if (w[i].poz == p){
cout<<w[i].scor<<" "<<i;
return 0;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |