| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 564810 | Piokemon | Poi (IOI09_poi) | C++17 | 224 ms | 16724 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int worth[2090];
int contestants[2090][2090];
pair<pair<int,int>,int> scores[2090];
bool comp(pair<pair<int,int>,int> a, pair<pair<int,int>,int> b){
    if (a.first.first > b.first.first){
        return 1;
    }
    else if (a.first.first < b.first.first){
        return 0;
    }
    if (a.first.second > b.first.second){
        return 1;
    }
    else if(a.first.second < b.first.second){
        return 0;
    }
    if (a.second < b.second){
        return 1;
    }
    else{
        return 0;
    }
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,t,p;
    cin >> n >> t >> p;
    for (int x=0;x<=t;x++){
        worth[x] = n;
    }
    for (int x=0;x<n;x++){
        for (int y=0;y<t;y++){
            cin >> contestants[x][y];
            if (contestants[x][y] == 1){
                worth[y] -= 1;
            }
        }
    }
    for (int x=0;x<n;x++){
        scores[x].first.first = 0;
        scores[x].first.second = 0;
        scores[x].second = x+1;
        for (int y=0;y<t;y++){
            if (contestants[x][y] == 1){
                scores[x].first.first += worth[y];
                scores[x].first.second += 1;
            }
        }
    }
    sort(scores,scores+n,comp);
    for (int x=0;x<n;x++){
        if (scores[x].second == p){
            cout << scores[x].first.first << ' ' << x+1 << "\n";
            return 0;
        }
    }
    return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
