Submission #555359

#TimeUsernameProblemLanguageResultExecution timeMemory
555359Tien_NoobCave (IOI13_cave)C++17
100 / 100
241 ms588 KiB
//Make CSP great again //Vengeance #include <bits/stdc++.h> #include <cave.h> #define TASK "TESTCODE" #define Log2(x) 31 - __builtin_clz(x) using namespace std; const int N = 5e3; int state[N + 1], door[N + 1]; void exploreCave(int n) { memset(door, -1, sizeof(door)); for (int i = 0; i < n; ++ i) { int low = 0, high = n - 1; bool need = (tryCombination(state) == i); while(low < high) { int mid = (low + high)/2; for (int j = low; j <= mid; ++ j) { if (door[j] == -1) { state[j] = 1; } } bool t = (tryCombination(state) == i); for (int j = low; j <= mid; ++ j) { if (door[j] == -1) { state[j] = 0; } } if (t == need) { low = mid + 1; } else { high = mid; } } door[low] = i; state[low] = need; } answer(state, door); } /*void read() { } void solve() { } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); if (fopen(TASK".INP", "r")) { freopen(TASK".INP", "r", stdin); //freopen(TASK".OUT", "w", stdout); } int t = 1; bool typetest = false; if (typetest) { cin >> t; } for (int __ = 1; __ <= t; ++ __) { //cout << "Case " << __ << ": "; read(); solve(); } }*/
#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...