# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
720704 | PenguinsAreCute | Poi (IOI09_poi) | C++17 | 608 ms | 6084 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |