제출 #235297

#제출 시각아이디문제언어결과실행 시간메모리
235297PbezzPoi (IOI09_poi)C++14
100 / 100
840 ms11128 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])<<" "<<i+1 <<'\n'; break; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...