제출 #835032

#제출 시각아이디문제언어결과실행 시간메모리
835032josiftepe동굴 (IOI13_cave)C++14
100 / 100
210 ms556 KiB
#include "cave.h" #include <bits/stdc++.h> const int maxn = 5050; int S[maxn], D[maxn]; int switched[maxn]; void exploreCave(int N) { for(int i = 0; i < N; i++) { int comb = (tryCombination(S) != i); int L = 0, R = N - 1; while(L < R) { int mid = (L + R) / 2; for(int j = L; j <= mid; j++) { if(!switched[j]) { S[j] = 1 - S[j]; } } int comb2 = (tryCombination(S) != i); for(int j = L; j <= mid; j++) { if(!switched[j]) { S[j] = 1 - S[j]; } } if(comb == comb2) { L = mid + 1; } else { R = mid; } } D[L] = i; if(comb == 0) { S[L] = 1 - S[L]; } switched[L] = 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...