Submission #940418

#TimeUsernameProblemLanguageResultExecution timeMemory
940418SundavarMonster Game (JOI21_monster)C++17
0 / 100
108 ms596 KiB
#include "monster.h" #include <bits/stdc++.h> using namespace std; std::vector<int> Solve(int N) { std::vector<int> T(N); vector<int> cnt(N); vector<int> amb1, amb2; for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++) if(j != i) cnt[i] += Query(i, j); if(cnt[i] == 1) amb1.push_back(i); if(cnt[i] == N-2) amb2.push_back(i); } (Query(amb1[0], amb1[1]) ? cnt[amb1[0]] : cnt[amb1[1]])--; (Query(amb2[0], amb2[1]) ? cnt[amb2[1]] : cnt[amb2[0]])++; for (int i = 0; i < N; i++) T[i] = cnt[i]; return T; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...