# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1031586 | ezzzay | Poi (IOI09_poi) | C++14 | 343 ms | 31572 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;
#define ff first
#define ss second
#define pb push_back
const int N=3e3;
int a[N][N];
int pnt[N];
signed main(){
int n,m,p;
cin>>n>>m>>p;
for(int i=1;i<=m;i++){
pnt[i]=0;
}
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cin>>a[i][j];
if(!a[i][j])pnt[j]++;
}
}
vector<pair<int,int>>v;
for(int i=1;i<=n;i++){
int s=0;
for(int j=1;j<=m;j++){
if(a[i][j]){
s+=pnt[j];
}
}
v.pb({-s,i});
}
sort(v.begin(),v.end());
for(int i=0;i<n;i++){
if(v[i].ss==p){
cout<<v[i].ff*-1<<" "<<i+1;
return 0;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |