# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
372885 | apostoldaniel854 | Poi (IOI09_poi) | C++14 | 283 ms | 16108 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;
const int MAX_N = 2000;
int verdict[1 + MAX_N][1 + MAX_N];
int score[1 + MAX_N];
#define pb push_back
struct Participant {
int score;
int cnt_solved;
int id;
bool operator < (const Participant &other) const {
if (score != other.score)
return score > other.score;
if (cnt_solved != other.cnt_solved)
return cnt_solved > other.cnt_solved;
return id < other.id;
}
};
int main () {
ios::sync_with_stdio (false);
cin.tie (0); cout.tie (0);
int n, t, p;
cin >> n >> t >> p;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= t; j++)
cin >> verdict[i][j], score[j] += 1 - verdict[i][j];
vector <Participant> standings;
for (int id = 1; id <= n; id++) {
int cur_score = 0, cnt = 0;
for (int i = 1; i <= n; i++)
cur_score += score[i] * verdict[id][i], cnt += verdict[id][i];
standings.pb ({cur_score, cnt, id});
}
sort (standings.begin (), standings.end ());
for (int i = 0; i < n; i++)
if (standings[i].id == p)
cout << standings[i].score << " " << i + 1 << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |