| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 485454 | asij123 | Poi (IOI09_poi) | C++14 | 604 ms | 23748 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n; int t; int p;
struct Contestant{
    int ID;
    int numSolved=0; int score=0; 
    int problemSet[2000]= {0};
 };
 bool comp(Contestant one, Contestant two){
    if(one.score== two.score){
        if(one.numSolved==two.numSolved){
            return one.ID > two.ID;
        }
        return one.numSolved< two.numSolved;
    }
    return one.score < two.score;
}
 int main(){
     cin >> n; cin >> t; cin >> p;
     Contestant arr [n];
     for(int i=1; i<= n; i++){
         Contestant& con= arr[i-1];
         con.ID= i;
         for(int j=0; j<t; j++){
             
             int ans; cin >>ans;
            
             con.problemSet[j]= ans;
             if(ans == 1){
                 con.numSolved++;
             }
        }
     }
     for(int i=0; i< t; i++){
        int points=0;
        for(Contestant& a: arr){
            if(a.problemSet[i]==0) points++;
        }
        for(Contestant& a: arr){
            if(a.problemSet[i]==1) a.score+=points;
           
        }
     }
     sort(arr, arr+n, comp);
     for(int i=0; i< n; i++){
         if(arr[i].ID== p){
             cout << arr[i].score << " " << (n-i);
         }
     }
     
     
 }
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
