제출 #575149

#제출 시각아이디문제언어결과실행 시간메모리
575149SamurajPoi (IOI09_poi)C++14
0 / 100
224 ms16032 KiB
#include <bits/stdc++.h> using namespace std; const int MAX_N = 2007; struct player{ int score{0}; int l_tasks{0}; int id{0}; vector<int> tasks; }; vector<player> gracze; int ile_zrobionych[MAX_N]{}; bool sortowanko(const player& p1,const player& p2){ if(p1.score < p2.score){ return true; } if(p1.score == p2.score){ if(p1.l_tasks < p2.l_tasks){ return true; } if(p1.l_tasks == p2.l_tasks){ if(p1.id < p2.id){ return true; } } } return false; } int main(){ ios::sync_with_stdio(0); cin.tie(); int n,t,p; cin >> n >> t >> p; for(int i = 1; i <= n; i++){ player gracz{}; gracz.id = i; for(int j = 1; j <= t; j++){ int x; cin >> x; if(x == 1){ ile_zrobionych[j]++; gracz.tasks.push_back(j); gracz.l_tasks++; } } gracze.push_back(gracz); } for(int i = 1; i <= n; i++){ for(auto j: gracze[i].tasks){ gracze[i].score += n-ile_zrobionych[j]; } } sort(gracze.begin(),gracze.end(),sortowanko); for(int i = 1; i<= n; i++){ if(gracze[i].id == p){ cout << gracze[i].score << ' ' << i; break; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...