# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
293969 | kshitij_sodani | Poi (IOI09_poi) | C++14 | 327 ms | 23840 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 a first
#define b second
#define pb push_back
typedef long long llo;
int n,m,t;
int it[2001][2001];
int co[2001];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>n>>m>>t;
vector<pair<pair<int,int>,int>> ss;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
cin>>it[i][j];
if(it[i][j]==0){
co[j]+=1;
}
}
}
for(int i=0;i<n;i++){
int so=0;
int so2=0;
for(int j=0;j<m;j++){
if(it[i][j]==1){
so+=co[j];
so2+=1;
}
}
ss.pb({{-so,-so2},i});
}
sort(ss.begin(),ss.end());
for(int i=0;i<n;i++){
if(ss[i].b==t-1){
cout<<-ss[i].a.a<<" "<<i+1<<endl;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |