제출 #1015952

#제출 시각아이디문제언어결과실행 시간메모리
1015952deeraPoi (IOI09_poi)C++14
100 / 100
339 ms8788 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, t, p; cin >> n >> t >> p; vector<int> tasks(t); vector<vector<bool>> comps(n, vector<bool>(t)); for(int j=0;j<n;j++) { for(int i=0;i<t;i++) { int x; cin >> x; if (x == 0) { tasks[i]++; } else { comps[j][i] = true; } } } vector<tuple<int, int, int>> scores(n); for (int i=0;i<n;i++) { int score = 0; int probs = 0; for (int j=0;j<t;j++) { if (comps[i][j]) { score += tasks[j]; probs++; } } scores[i] = make_tuple(score, probs, n-i); } sort(scores.begin(), scores.end(), greater<tuple<int, int, int>>()); int rank = 0; for (auto score: scores) { rank++; if (get<2>(score) == n-(p-1)) { cout << get<0>(score) << " " << rank << endl; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...