Submission #1289935

#TimeUsernameProblemLanguageResultExecution timeMemory
1289935muhammad-ahmadCave (IOI13_cave)C++20
0 / 100
307 ms512 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int N) { int x, st[N], D[N], Q[N]; for (int i = 0; i < N; i++) st[i] = D[i] = -1; for (int i = 0; i < N; i++){ int cur = 0; for (int j = 0; j < N; j++){ if (st[j] != -1) Q[j] = 0; else Q[j] = st[j]; } x = tryCombination(Q); if (x > i or x == -1) cur = 1; int l = 0, r = N; while (r - l > 1){ int m = (l + r) / 2; for (int j = 0; j < N; j++){ if (st[j] != -1) Q[j] = st[j]; else if (j >= l && j <= m) Q[j] = cur; else Q[j] = !cur; } x = tryCombination(Q); if (x > i or x == -1) r = m + 1; else l = m + 1; } st[l] = cur; D[l] = i; } answer(st, D); } // int main(){ // exploreCave(2); // }
#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...