제출 #235293

#제출 시각아이디문제언어결과실행 시간메모리
235293PbezzPoi (IOI09_poi)C++14
5 / 100
858 ms18936 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define INF 10000 #define MAXN 100005 typedef pair<ll int,ll int> pii; int main(){ ll int n,t,p,i,j,k; cin>>n>>t>>p; vector<tuple<ll int,ll int, ll int> >ahm(n); vector<ll int>solved(t); vector<vector<int>>list(t); for(i=0;i<n;i++){ get<2>(ahm[i])=i; for(j=0;j<t;j++){ cin>>k; if(k==1){ solved[j]++; list[j].push_back(i); get<1>(ahm[i])--; } } } for(j=0;j<t;j++){ k=n-solved[j]; for(auto u:list[j]){ get<0>(ahm[u])-=k; } } sort(ahm.begin(),ahm.end()); for(i=0;i<n;i++){ if(get<2>(ahm[i])!=p-1)continue; cout<<-get<0>(ahm[i])<<" "<<-get<1>(ahm[i])<<'\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...