Submission #28624

#TimeUsernameProblemLanguageResultExecution timeMemory
28624tlwpdus 팬클럽 회장 (#68)Bulb Game (FXCUP2_bulb)C++14
1 / 1
0 ms1132 KiB
#include "bulb.h" static int chk[1010]; void Init(int N){ chk[0] = chk[N + 1] = 1; } int MakeTurn(int M){ chk[M] = 1; int lc = 0, rc = 0; for(int i = M - 1; !chk[i]; i--) lc++; for(int i = M + 1; !chk[i]; i++) rc++; if(lc % 2){ chk[M - 1] = 1; return M - 1; } chk[M + 1] = 1; return M + 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...