제출 #501717

#제출 시각아이디문제언어결과실행 시간메모리
501717dnaux동굴 (IOI13_cave)C++17
0 / 100
476 ms432 KiB
#include <bits/stdc++.h> #include "cave.h" #define endline "\n" #define pb push_back #define mp make_pair #define st first #define nd second #define lsb(i) i&(-i) #define sz(i) (int)i.size() typedef long long ll; using namespace std; const ll INF = 1e18L; constexpr int mod = int(1e9) + 7; ll t=1, n, k, cases = 0; void exploreCave(int n){ int check[n],door[n]; for(int i = 0; i < n; i++)check[i] = -1; for(int i = 0; i < n; i++){ int comb[n] = {}; for(int i = 0; i < n; i++){ if(check[i] != -1)comb[i] = check[i]; } int cur; if(tryCombination(comb) > i)cur = 0; else cur = 1; int l = 1, r = n + 1; while(r - l > 1){ int m = (r + l) / 2; for(int i = 0; i < n; i++){ if(check[i] != -1)comb[i] = check[i]; else if(i >= l and i <= m)comb[i] = cur; else comb[i] = cur ^ 1; } if(tryCombination(comb) > i)r = m; else l = m; } check[l] = cur; door[l] = i; } answer(check, door); }
#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...