# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
933634 | Neytrino | Poi (IOI09_poi) | C++14 | 193 ms | 23860 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.
/**
* author: inastranets
* created: 26.02.2024 05:31:30
**/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, t, p;
cin >> n >> t >> p;
vector<vector<int>> solved(n, vector<int>(t, 0));
vector<int> points(t, 0);
for (int i = 0; i < n; ++ i) {
for (int j = 0; j < t; ++ j) {
cin >> solved[i][j];
points[j] += (solved[i][j] == 0);
}
}
vector<pair<int,int> > score;
for (int i = 0; i < n; ++ i) {
int result = 0;
for (int j = 0; j < t; ++ j) {
if (solved[i][j]) {
result += points[j];
}
}
score.push_back({result, i + 1});
}
sort(score.begin(), score.end(), [](const pair<int,int>& a, const pair<int,int>& b) {
if (a.first == b.first) {
return a.second < b.second;
}
return a.first < b.first;
});
for (int i = 0; i < n; ++ i) {
auto [rank, id] = score[i];
if (id == p) {
cout << rank << ' ' << i + 1;
break;
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |