(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #611679

#TimeUsernameProblemLanguageResultExecution timeMemory
611679jhnah917Cave (IOI13_cave)C++14
100 / 100
251 ms672 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int A[5000], Pos[5000], Fin[5000]; void exploreCave(int n){ for(int i=0; i<n; i++){ int l = 0, r = n-1; int now = tryCombination(A); if(now == -1) now = 1e9; assert(now >= i); while(l < r){ int m = (l + r) / 2; for(int j=l; j<=m; j++) if(!Fin[j]) A[j] ^= 1; int t = tryCombination(A); if(t == -1) t = 1e9; for(int j=l; j<=m; j++) if(!Fin[j]) A[j] ^= 1; if((now > i) != (t > i)) r = m; else l = m + 1; } Pos[r] = i; Fin[r] = 1; if(now <= i) A[r] ^= 1; } answer(A, Pos); }
#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...