# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
978957 | tamir1 | Poi (IOI09_poi) | C++17 | 220 ms | 12148 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>
#define ll long long
using namespace std;
struct ct{
ll pt,sd,id;
};
ct x[2005];
ll n,t,me,i,j,p[2005];
bool a[2005][2005];
bool cmp(ct a,ct b){
if(a.pt==b.pt && a.sd==b.sd) return a.id<b.id;
if(a.pt==b.pt) return a.sd>b.sd;
return a.pt>b.pt;
}
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin >> n >> t >> me;
for(i=1;i<=n;i++)
for(j=1;j<=t;j++){
cin >> a[i][j];
if(!a[i][j]) p[j]++;
}
for(i=1;i<=n;i++){
x[i].id=i;
for(j=1;j<=t;j++){
if(a[i][j]){
x[i].sd++;
x[i].pt+=p[j];
}
}
}
sort(x+1,x+n+1,cmp);
for(i=1;i<=n;i++){
if(x[i].id==me){
cout << x[i].pt << " " << i;
return 0;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |