| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 988881 | lo0ker | Poi (IOI09_poi) | C++17 | 204 ms | 24000 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// source : https://dmoj.ca/problem/ioi09p3
#include <bits/stdc++.h>
using namespace std;
#define sz(v) ((int)(v).size)
#define all(v) (v).begin(), (v).end()
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
const long long INF = 1e17;
const int MOD = 1e9+7;
struct con{
  int all_score;
  int num_solved;
  int id;
  bool operator<(const con& b){
    if(all_score != b.all_score){
      return all_score > b.all_score;
    }
    if(num_solved != b.num_solved){
      return num_solved > b.num_solved;
    }
    return id < b.id;
  }
};
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  int n, t, p;
  cin >> n >> t >> p;
  p--;
  int in;
  vector<vi> solved(n+1, vi(t));
  vector<con> cons(n);
  vi score(t, 0);
  for(int i = 0; i < n; i++){
    cons[i].id = i;
    for(int j = 0; j < t; j++){
      cin >> solved[i][j];
      if(solved[i][j] == 0) {
        score[j]++;
      }
      cons[i].num_solved += solved[i][j];
    }
  }
  for(int i = 0; i < n; i++){
    for(int j = 0; j < t; j++){
      if(solved[i][j]){
        cons[i].all_score += score[j];
      }
    }
  }
  sort(all(cons));
  for(int i = 0; i < n; i++){
    //cout << cons[i].all_score << " " << cons[i].num_solved << " " << cons[i].id << '\n';
    if(cons[i].id == p){
      cout << cons[i].all_score << " " << i+1;
      break;
    }
  }
  return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
