Submission #575149

# Submission time Handle Problem Language Result Execution time Memory
575149 2022-06-09T19:14:30 Z Samuraj Poi (IOI09_poi) C++14
0 / 100
224 ms 16032 KB
#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 = 1; 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<= n; i++){
    if(gracze[i].id == p){
      cout << gracze[i].score << ' ' << i;
      break;
    }
  }


}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 320 KB Output isn't correct
2 Runtime error 1 ms 468 KB Execution killed with signal 11
3 Incorrect 1 ms 212 KB Output isn't correct
4 Incorrect 1 ms 328 KB Output isn't correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Incorrect 1 ms 212 KB Output isn't correct
7 Incorrect 1 ms 340 KB Output isn't correct
8 Incorrect 1 ms 336 KB Output isn't correct
9 Incorrect 2 ms 468 KB Output isn't correct
10 Incorrect 2 ms 340 KB Output isn't correct
11 Incorrect 7 ms 724 KB Output isn't correct
12 Incorrect 12 ms 1108 KB Output isn't correct
13 Incorrect 35 ms 2596 KB Output isn't correct
14 Incorrect 47 ms 3580 KB Output isn't correct
15 Incorrect 82 ms 6180 KB Output isn't correct
16 Incorrect 91 ms 6700 KB Output isn't correct
17 Incorrect 132 ms 9812 KB Output isn't correct
18 Incorrect 150 ms 11020 KB Output isn't correct
19 Incorrect 195 ms 14508 KB Output isn't correct
20 Incorrect 224 ms 16032 KB Output isn't correct