| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 575409 | Samuraj | Poi (IOI09_poi) | C++14 | 226 ms | 16164 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2007;
struct player{
  int score{0};
  int l_tasks{0};
  int id{0};
  vector<int> tasks;
};
vector<player> gracze;
int ile_zrobionych[MAX_N]{};
bool sortowanko(const player& p1,const player& p2){
  if(p1.score > p2.score){
    return true;
  }
  if(p1.score == p2.score){
    if(p1.l_tasks > p2.l_tasks){
      return true;
    }
    if(p1.l_tasks == p2.l_tasks){
      if(p1.id < p2.id){
        return true;
      }
    }
  }
  return false;
}
int main(){
  ios::sync_with_stdio(0);
  cin.tie();
  int n,t,p;
  cin >> n >> t >> p;
  for(int i = 1; i <= n; i++){
    player gracz{};
    gracz.id = i;
    for(int j = 1; j <= t; j++){
      int x;
      cin >> x;
      if(x == 1){
        ile_zrobionych[j]++;
        gracz.tasks.push_back(j);
        gracz.l_tasks++;
      }
    }
    gracze.push_back(gracz);
  }
  for(int i = 0; i < n; i++){
    for(auto j: gracze[i].tasks){
      gracze[i].score += n-ile_zrobionych[j];
    }
  }
  sort(gracze.begin(),gracze.end(),sortowanko);
  /*
  for(int i = 1; i<=t; i++){
    cout << "task: " << i << " ile_zrobionych: " << ile_zrobionych[i] << '\n';
  }
  for(auto i : gracze){
    cout << "id: " << i.id << " score: " << i.score << '\n' ;
  }
  */
  for(int i = 0; i < n; i++){
    if(gracze[i].id == p){
      cout << gracze[i].score << ' ' << i+1;
      break;
    }
  }
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
