제출 #771884

#제출 시각아이디문제언어결과실행 시간메모리
771884BlockOGPoi (IOI09_poi)C++14
0 / 100
460 ms15968 KiB
#include <iostream> #include <algorithm> #include <utility> using namespace std; /* 5 3 2 0 0 1 1 1 0 1 0 0 1 1 0 1 1 0 */ int solved[2000][2000]; int not_solved[2000]; pair<int, pair<int, int>> score[2000]; int main() { int n, t, p; cin >> n >> t >> p; p--; for (int i = 0; i < n; i++) { score[i].second.second = i; for (int j = 0; j < t; j++) { cin >> solved[i][j]; if (solved[i][j]) score[i].second.first--; else not_solved[j]++; } } for (int i = 0; i < n; i++) { for (int j = 0; j < t; j++) { if (solved[i][j]) score[i].first -= not_solved[j]; } } sort(score, score + n); for (int i = 0; i < n; i++) { if (score[i].second.second == p) { cout << i + 1 << endl; break; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...