| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 495538 | PiejanVDC | Poi (IOI09_poi) | C++17 | 573 ms | 888 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
signed main() {
    int n,t,p; cin>>n>>t>>p;
    vector<int>v(t,n);
    vector<int>cnt(n,0);
    vector<vector<bool>>l(n,vector<bool>(t,0));
    for(int i = 0 ; i < n ; i++) {
        for(int j = 0 ; j < t ; j++) {
            int x; cin>>x;
            if(x) l[i][j] = 1;
            if(l[i][j]) v[j]--,cnt[i]++;
        }
    }
    vector<pair<int,int>>scores;
    int sc;
    for(int i = 0 ; i < n ; i++) {
        int score = 0;
        for(int j = 0 ; j < t ; j++) {
            if(l[i][j]) score += v[j];
        }
        scores.push_back({score,i});
        if(i == p-1) sc = score;
    }
    p--;
    int pos = 1;
    for(int i = 0 ; i < n ; i++) {
        if(scores[i].second == p) continue;
        if(scores[i].first > sc) pos++;
        else if(scores[i].first == scores[p].first) {
            if(cnt[scores[i].second] > cnt[p]) pos++;
            else if(cnt[scores[i].second] == cnt[p]) {
                if(scores[i].second < p) pos++;
            }
        }
    }
    cout << scores[p].first << " " << pos;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
