제출 #608827

#제출 시각아이디문제언어결과실행 시간메모리
608827DeMen100nsMonster Game (JOI21_monster)C++17
0 / 100
261 ms336 KiB
/* Author : DeMen100ns (a.k.a Vo Khac Trieu) School : VNU-HCM High school for the Gifted fuck you adhoc */ #include <monster.h> namespace { const int N = 1005; bool f[N][N]; int cnt[N]; }; std::vector<int> Solve(int n) { if (n == 1){ return {0}; } if (n == 2){ bool f = Query(0, 1); if (f) return {0, 1}; else return {1, 0}; } for(int i = 0; i < n; ++i){ for(int j = i + 1; j < n; ++j){ f[i][j] = Query(i, j); cnt[i] += f[i][j]; cnt[j] += (!f[i][j]); } } std::vector <int> ans(n); int luu1 = -1, luu2 = -1; for(int i = 0; i < n; ++i){ if (cnt[i] < n - 1){ ans[i] = cnt[i] - 1; } else{ if (luu1 == -1) luu1 = i; else luu2 = i; } } ans[luu1] = ans[luu2] = n - 1; if (f[luu1][luu2]) ans[luu1] = n - 2; else ans[luu2] = n - 2; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...