제출 #960277

#제출 시각아이디문제언어결과실행 시간메모리
960277SoSmolSten동굴 (IOI13_cave)C++17
0 / 100
24 ms516 KiB
#include "cave.h" const int SZ = 5010; int s[SZ]; int d[SZ]; void exploreCave(int N) { for(int i = 0; i < N; ++i){ s[i] = 1; } int v = tryCombination(s); while(v != -1){ int l = 0, r = N - 1; while(l <= r){ if(l == r) break; int mid = (l + r) >> 1; for(int i = l; i <= mid; ++i){ s[i] ^= 1; } int t = tryCombination(s); for(int i = l; i <= mid; ++i){ s[i] ^= 1; } if(t > v) r = mid - 1; else l = mid + 1; } s[l] ^= 1; v = tryCombination(s); } for(int i = 0; i < N; ++i){ s[i] ^= 1; d[i] = tryCombination(s); s[i] ^= 1; } answer(s, d); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...