| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 423773 | haxorman | Poi (IOI09_poi) | C++14 | 340 ms | 16032 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int mxN = 2007;
int tasks[mxN], solved[mxN][mxN];
pair<int,pair<int,int>> points[mxN];
int32_t main() {
    ios_base::sync_with_stdio(0); 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 >> solved[i][j];
            if (!solved[i][j])
                tasks[j]++;
        }
    }
    for (int i = 1; i <= n; ++i) {
        int cur = 0, cnt = 0;
        for (int j = 1; j <= t; ++j) {
            if (solved[i][j]) {
                cnt++;
                cur += tasks[j];
            }
        }
        points[i] = {cur, {cnt, i}};
    }
    sort(points + 1, points + n + 1, greater<pair<int,pair<int,int>>>());
    bool ok = false;
    while (!ok) {
        ok = true;
        for (int i = 2; i <= n && ok; ++i) {
            if (points[i].first == points[i - 1].first &&
                points[i].second.first == points[i - 1].second.first &&
                points[i].second.second < points[i - 1].second.second) {
                swap(points[i], points[i - 1]);
                ok = false;
            }
        }
    }
    for (int i = 1; i <= n; ++i) {
        auto cur = points[i];
        if (points[i].second.second == p) {
            cout << points[i].first << ' ' << i << "\n";
            break;
        }
    }
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
