Submission #420016

#TimeUsernameProblemLanguageResultExecution timeMemory
420016vkgainzMonster Game (JOI21_monster)C++17
0 / 100
213 ms280 KiB
#include <bits/stdc++.h> #include <monster.h> using namespace std; bool Query(int a, int b); std::vector<int> Solve(int N) { vector<int> T(N); if(N == 1) return T; vector<int> win(N); for(int i = 0; i < N; i++) { for(int j = i + 1; j < N; j++) { if(Query(i, j)) ++win[i]; else ++win[j]; } } for(int i = 0; i < N; i++) { if(win[i] < N - 2 && win[i] > 1) T[i] = win[i]; } if(N == 2) { for(int i = 0; i < N; i++) T[i] = 1 - win[i]; return T; } for(int i = 0; i < N; i++) { for(int j = i + 1; j < N; j++) { if(win[i] == 1 && win[j] == 1) { if(Query(i, j)) T[i] = 0, T[j] = 1; } } } for(int i = 0; i < N; i++) { for(int j = i + 1; j < N; j++) { if(win[i] == N - 2 && win[j] == N - 2) if(Query(i, j)) T[i] = N - 2, T[j] = N - 1; } } return T; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...