| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 300288 | fpc_coder | Poi (IOI09_poi) | C++17 | 1138 ms | 16432 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
struct Contestant {
    int score, ntasks, id;
};
const int N = 2005;
int status[N][N], task_score[N];
Contestant contestants[N];
bool cmp(Contestant a, Contestant b) {
    if (a.score != b.score) return a.score > b.score;
    if (a.ntasks != b.ntasks) return a.ntasks > b.ntasks;
    return a.id < b.id;
}
int main() {
    int n, t, p;
    cin >> n >> t >> p;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= t; j++) cin >> status[i][j];
    }
    for (int j = 1; j <= t; j++) {
        for (int i = 1; i <= n; i++) task_score[j] += (status[i][j] == 0);
    }
    for (int i = 1; i <= n; i++) {
        contestants[i].score = 0;
        contestants[i].ntasks = 0;
        contestants[i].id = i;
        for (int j = 1; j <= t; j++) {
            if (status[i][j]) {
                contestants[i].score += task_score[j];
                contestants[i].ntasks++;
            }
        } 
    }
    sort(contestants + 1, contestants + n + 1, cmp);
    for (int i = 1; i <= n; i++) {
        if (contestants[i].id == p) {
            cout << contestants[i].score << ' ' << i << '\n';
            return 0;
        }
    }
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
