| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 931391 | thisisadarsh | Poi (IOI09_poi) | C++14 | 493 ms | 16156 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    int N, T, P;
    cin >> N >> T >> P;
    vector<vector<int>> solved(N, vector<int>(T));
    // Read which tasks were solved by each contestant
    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < T; ++j) {
            cin >> solved[i][j];
        }
    }
    vector<int> scores(N, 0);
    // Calculate scores for each contestant
    for (int j = 0; j < T; ++j) {
        int unsolved = 0; // Number of contestants who didn't solve this task
        for (int i = 0; i < N; ++i) {
            if (solved[i][j] == 0) {
                unsolved++;
            }
        }
        for (int i = 0; i < N; ++i) {
            if (solved[i][j] == 1) {
                scores[i] += unsolved;
            }
        }
    }
    // Find Philip's score
    int philip_score = scores[P - 1];
    // Find Philip's rank
    int philip_rank = 1;
    for (int i = 0; i < N; ++i) {
        if (scores[i] > philip_score || (scores[i] == philip_score && i < P - 1)) {
            philip_rank++;
        }
    }
    cout << philip_score << " " << philip_rank << endl;
    return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
