제출 #1100188

#제출 시각아이디문제언어결과실행 시간메모리
1100188radaiosm7동굴 (IOI13_cave)C++98
0 / 100
22 ms65536 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int corrState, l, r; bool done[5005]; vector<int> switches; void exploreCave(int N) { for (int i=0; i < N; ++i) done[i] = false; int S[N], D[N]; for (int i=0; i < N; ++i) { switches.clear(); for (int j=0; j < N; ++i) if (!done[j]) switches.push_back(j); for (int j=0; j < N-i; ++j) S[switches[j]] = 0; corrState = (tryCombination(S) == i) ? 1 : 0; for (int j=0; j < N-i; ++j) S[switches[j]] = corrState^1; l = 0; r = N-i-1; while (l < r) { int mid = (l+r)/2; for (int j=l; j <= mid; ++j) S[switches[j]] = corrState; int firstOpen = tryCombination(S); for (int j=l; j <= mid; ++j) S[switches[j]] = corrState^1; if (firstOpen == i) l = mid+1; else r = mid; } done[switches[l]] = true; S[switches[l]] = corrState; D[switches[l]] = i; } 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...