제출 #764612

#제출 시각아이디문제언어결과실행 시간메모리
764612hfoliacots동굴 (IOI13_cave)C++14
0 / 100
1 ms340 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int N) { int s[N], d[N]; vector<bool> vis(N, false); memset(s, 0, sizeof s); memset(d, 0, sizeof d); int pant, p = tryCombination(s); int l = 0, r = N-1, mid = (l+r)/2; for (int k = 0; k < N; k++) { while (l < r) { for (int i = l; i <= mid; i++) { if (!vis[i]) s[i] = !s[i]; } pant = p; p = tryCombination(s); if (p == k && pant == k) l = mid+1; else if (p != k && pant != k) l = mid+1; else r = mid; mid = (l+r)/2; } d[r] = k; vis[r] = true; if (p == k) s[r] = !s[r]; } 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...