Submission #293969

#TimeUsernameProblemLanguageResultExecution timeMemory
293969kshitij_sodaniPoi (IOI09_poi)C++14
100 / 100
327 ms23840 KiB
#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 timeMemoryGrader output
Fetching results...