| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 1097418 | vjudge1 | Poi (IOI09_poi) | C++17 | 199 ms | 39632 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
#ifndef LOCAL
#define debug(...)
#endif
#define SZ(x)  ((int) x.size())
#define int    long long
#define vi     vector<int>
#define vvi    vector<vector<int>>
#define endl  '\n'
#define pii    pair<int, int>
#define all(v) (v).begin(), (v).end()
template <typename T>
istream &operator>>(istream& is,  vector<T> &v) {
    for (auto &x: v) is >> x;
    return is;
}
struct cand {
    int score, solved, id;
};
void run_test() {
    int n, t, p;
    cin >> n >> t >> p;
    p--;
    vector<vector<int>> a(n, vector<int>(t));
    cin >> a;
    vector<int> points(t, 0);
    for (int i = 0; i < t; i++) {
        for (int j = 0; j < n; j++) {
            points[i] += (a[j][i] == 0);
        }
    }
    vector<int> score(n, 0);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < t; j++) {
            score[i] += a[i][j] * (points[j]);
        }
    }
    vector<int> solved(n, 0);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < t; j++) {
            solved[i] += (a[i][j] == 1);
        }
    }
    vector<cand> v;
    for (int i = 0; i < n; i++) {
        v.push_back({ score[i], solved[i], i });
    }
    sort(all(v), [](cand a, cand b) {
        if (a.score > b.score) return true;
        if (a.score == b.score) {
            if (a.solved > b.solved) return true;
            if (a.solved == b.solved) return a.id < b.id;
            return false;
        }
        return false;
    });
    for (int i = 0; i < n; i++) {
        if (v[i].id == p) {
            cout << v[i].score << " " << i+1 << endl;
            return;
        }
    }
}
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int tc = 1;
    // cin >> tc;
    while (tc--) {
        run_test();
    }
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
