Submission #427719

# Submission time Handle Problem Language Result Execution time Memory
427719 2021-06-14T19:56:31 Z DanerZein Monster Game (JOI21_monster) C++17
10 / 100
268 ms 532 KB
#include "monster.h"
#include <bits/stdc++.h>
namespace {

bool example_variable;

}  // namespace
using namespace std;
typedef vector<int> vi;
vector<vi> wins;
std::vector<int> Solve(int N) {
  wins.clear();
  wins.resize(N);
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;j++){
      if(Query(i,j))
	wins[i].push_back(j);
      else wins[j].push_back(i);
    }
  }
  int id=-1;
  for(int i=0;i<N;i++){
    if(wins[i].size()==1 && wins[wins[i][0]].size()==1){
      id=i;
      break;
    }
  }
  vector<int> res(N,-1);
  res[id]=0;
  int u=wins[id][0];
  for(int i=1;i<N;i++){
    res[u]=i;
    for(auto &v:wins[u]){
      if(res[v]==-1){
	u=v;
	break;
      }
    }
  }
  return res;
}

Compilation message

monster.cpp:5:6: warning: '{anonymous}::example_variable' defined but not used [-Wunused-variable]
    5 | bool example_variable;
      |      ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 284 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 1 ms 200 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 1 ms 200 KB Output is correct
8 Correct 1 ms 200 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 1 ms 264 KB Output is correct
11 Correct 1 ms 200 KB Output is correct
12 Correct 1 ms 200 KB Output is correct
13 Correct 1 ms 200 KB Output is correct
14 Correct 1 ms 200 KB Output is correct
15 Correct 1 ms 200 KB Output is correct
16 Correct 158 ms 320 KB Output is correct
17 Correct 202 ms 352 KB Output is correct
18 Correct 179 ms 484 KB Output is correct
19 Correct 118 ms 312 KB Output is correct
20 Correct 204 ms 412 KB Output is correct
21 Correct 1 ms 200 KB Output is correct
22 Correct 1 ms 200 KB Output is correct
23 Correct 1 ms 200 KB Output is correct
24 Correct 1 ms 256 KB Output is correct
25 Correct 1 ms 200 KB Output is correct
26 Correct 268 ms 320 KB Output is correct
27 Correct 1 ms 200 KB Output is correct
28 Correct 1 ms 200 KB Output is correct
29 Correct 1 ms 200 KB Output is correct
30 Correct 1 ms 200 KB Output is correct
31 Correct 1 ms 256 KB Output is correct
32 Correct 132 ms 440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 284 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 1 ms 200 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 1 ms 200 KB Output is correct
8 Correct 1 ms 200 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 1 ms 264 KB Output is correct
11 Correct 1 ms 200 KB Output is correct
12 Correct 1 ms 200 KB Output is correct
13 Correct 1 ms 200 KB Output is correct
14 Correct 1 ms 200 KB Output is correct
15 Correct 1 ms 200 KB Output is correct
16 Correct 158 ms 320 KB Output is correct
17 Correct 202 ms 352 KB Output is correct
18 Correct 179 ms 484 KB Output is correct
19 Correct 118 ms 312 KB Output is correct
20 Correct 204 ms 412 KB Output is correct
21 Correct 1 ms 200 KB Output is correct
22 Correct 1 ms 200 KB Output is correct
23 Correct 1 ms 200 KB Output is correct
24 Correct 1 ms 256 KB Output is correct
25 Correct 1 ms 200 KB Output is correct
26 Correct 268 ms 320 KB Output is correct
27 Correct 1 ms 200 KB Output is correct
28 Correct 1 ms 200 KB Output is correct
29 Correct 1 ms 200 KB Output is correct
30 Correct 1 ms 200 KB Output is correct
31 Correct 1 ms 256 KB Output is correct
32 Correct 132 ms 440 KB Output is correct
33 Incorrect 266 ms 516 KB Wrong Answer [6]
34 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 252 ms 532 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -