# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1015952 | deera | Poi (IOI09_poi) | C++14 | 339 ms | 8788 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;
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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |