# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
415277 | Antekb | Poi (IOI09_poi) | C++14 | 753 ms | 16008 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 st first
#define nd second
using namespace std;
const int N=2005;
int tab[N][N];
int sco[N];
int main(){
int n, m, t;
cin>>n>>m>>t;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
cin>>tab[i][j];
sco[j]+=1-tab[i][j];
}
}
vector<pair<pair<int, int>, int> > V;
int ans=0;
for(int i=0; i<n; i++){
int k=0, l=0;
for(int j=0; j<m; j++){
k+=sco[j]*tab[i][j];
l+=tab[i][j];
}
if(i==t-1)ans=k;
V.push_back({{k, l}, -i});
}
sort(V.begin(), V.end());
//reverse(V.begin(), V.end());
cout<<ans<<" ";
for(int i=0; i<n; i++)if(V[i].nd==1-t){
cout<<n-i;
break;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |