Submission #530069

#TimeUsernameProblemLanguageResultExecution timeMemory
530069buidangnguyen05Cave (IOI13_cave)C++14
0 / 100
321 ms392 KiB
/* input */ #include "cave.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 5e3; int n, done[N], state[N], que[N]; int query(int R) { for (int i = 0; i < n; ++i) { if (done[i] != -1) que[i] = state[i]; else que[i] = (i <= R); } return tryCombination(que); } void exploreCave(int _n) { memset(done, -1, sizeof(done)); n = _n; int prev = query(0); for (int i = 0; i < n; ++i) { int L = -1, R = n - 1, pos = 0; while (L <= R) { int mid = (L + R) >> 1; int cur = query(mid); if ((prev == i && cur != i) || (prev != i && cur == i)) { pos = mid; R = mid - 1; } else L = mid + 1; } if (prev == i) state[pos] = 1; done[pos] = i; prev = query(0); } answer(state, done); }
#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...