| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 541953 | DemonLord154 | Poi (IOI09_poi) | C++14 | 605 ms | 15968 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<vector>
#include<bits/stdc++.h>
using namespace std;
struct Player{
  int score;
  int id;
  int probSolved;
};
bool comparator(Player player1,Player player2){
  if (player1.score != player2.score){
    return player1.score<player2.score;
  }
  if (player1.probSolved!= player2.probSolved){
    return player1.probSolved < player2.probSolved;
  }
  return player1.id>player2.id;
}
int main(){
  int n,t,p;
  cin>>n>>t>>p;
  vector<Player> players(n);
  int scores[n][t];
  for (int i=0;i<n;i++){
    for (int j=0;j<t;j++){
      cin>>scores[i][j];
    }
  }
  vector<int> eachTestScore(t);
  for (int i=0;i<t;i++){
    int score=0;
    for (int j=0;j<n;j++){
      if (scores[j][i]==0){
        score++;
      }
    }
    eachTestScore[i]=score;
  }
  for (int i=0;i<n;i++){
    int playerScore=0,probsolved=0;
    for (int j=0;j<t;j++){
      if (scores[i][j]==1){
        playerScore+=eachTestScore[j];
        probsolved++;
      }
    }
    players[i].score=playerScore;
    players[i].id=i;
    players[i].probSolved=probsolved;
  }
  sort(players.begin(),players.end(),comparator);
  for (int i=0;i<n;i++){
    if (players[i].id==p-1){
      cout<<players[i].score<<" "<<n-i<<endl;
      break;
    }
  }
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
