제출 #1227672

#제출 시각아이디문제언어결과실행 시간메모리
1227672lukasuliashviliPoi (IOI09_poi)C++20
100 / 100
414 ms31848 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define fs first #define sc second #define pb push_back const int N=2005; pair<pair<int,int> ,int> st[N]; int a[N][N],scr[N],raod[N],sum[N]; signed main(){ int n,t,p; cin>>n>>t>>p; for(int i=1; i<=n; i++){ for(int j=1; j<=t; j++){ cin>>a[i][j]; if(a[i][j]==1){ raod[i]++; } } } for(int j=1; j<=t; j++){ for(int i=1; i<=n; i++){ if(a[i][j]==0){ scr[j]+=1; } } } for(int i=1; i<=n; i++){ for(int j=1; j<=t; j++){ if(a[i][j]==1){ sum[i]+=scr[j]; } } } for(int i=1; i<=n; i++){ st[i].fs.fs=sum[i]; st[i].fs.sc=raod[i]; st[i].sc=-i; } sort(st+1,st+n+1);reverse(st+1,st+n+1); // for(int i=1; i<=n; i++){ // cout<<st[i].fs.fs<<" "<<st[i].fs.sc<<" "<<st[i].sc<<endl; // } for(int i=1; i<=n; i++){ if(st[i].sc==-p){ cout<<st[i].fs.fs<<" "<<i<<endl; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...