Submission #672750

#TimeUsernameProblemLanguageResultExecution timeMemory
672750Hacv16Cave (IOI13_cave)C++17
100 / 100
284 ms588 KiB
#include<bits/stdc++.h> #include "cave.h" using namespace std; typedef long long ll; const int MAX = 2e6 + 15; const int INF = 0x3f3f3f3f; bool mark[MAX]; void exploreCave(int n){ int S[n] = { 0 }, D[n] = { 0 }; for(int door = 0; door < n; door++){ for(int i = 0; i < n; i++) if(!mark[i]) S[i] = 0; int color = (tryCombination(S) == door); int l = 0, r = n - 1; while(l < r){ ll m = (l + r + 1) >> 1; for(int i = l; i < m; i++) if(!mark[i]) S[i] = color; for(int i = m; i <= r; i++) if(!mark[i]) S[i] = !color; int query = tryCombination(S); if(query == door) l = m; else r = m - 1; } mark[l] = true; D[l] = door; S[l] = color; } 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...