Submission #720704

#TimeUsernameProblemLanguageResultExecution timeMemory
720704PenguinsAreCutePoi (IOI09_poi)C++17
100 / 100
608 ms6084 KiB
#include <bits/stdc++.h> using namespace std; #define int long long typedef pair<int,int> ii; typedef pair<int,ii> iii; int32_t main() { int N, T, P; cin >> N >> T >> P; bool solved[N][T]; int score[T]; vector<iii> scores; for(int i = 0; i < N; i++) for(int j = 0; j < T; j++) cin >> solved[i][j]; for(int i = 0; i < T; i++) { score[i] = 0; for(int j = 0; j < N; j++) if(!solved[j][i]) score[i]++; } for(int i = 0; i < N; i++) { int curScore = 0, solvedProblems = 0; for(int j = 0; j < T; j++) if(solved[i][j]) {curScore += score[j]; solvedProblems++;} scores.push_back(iii(curScore, ii(solvedProblems, N - i))); } sort(scores.begin(), scores.end(), greater<iii>()); for(int i = 0; i < N; i++) { if(N - scores[i].second.second == P - 1) cout << scores[i].first << " " << i + 1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...