| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 372887 | apostoldaniel854 | Poi (IOI09_poi) | C++14 | 284 ms | 16164 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 <= t; 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... | ||||
