# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
860809 | Kak008723 | Poi (IOI09_poi) | C++14 | 206 ms | 4432 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;
int n,m,k,b[2005];
vector<int> c;
bool a[2005][2005];
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n>>m>>k;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cin>>a[i][j];
}
}
for(int i=1;i<=m;i++){
int ans = 0;
for(int j=1;j<=n;j++){
ans+=a[j][i];
}
ans=n-ans;
b[i]=ans;
}
//for(int i=1;i<=m;i++) cout<<b[i]<<' ';
//cout<<'\n';
int now = 0 ;
for(int i=1;i<=n;i++){
int x = 0;
for(int j=1;j<=m;j++){
x+=a[i][j]*b[j];
}
if(i==k) now = x;
c.push_back(x);
}
cout<<now;
sort(c.rbegin(),c.rend());
int i = 0;
while(c[i]!=now) i++;
cout<<' '<<i+1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |