Submission #485347

#TimeUsernameProblemLanguageResultExecution timeMemory
485347silverfishCave (IOI13_cave)C++14
0 / 100
32 ms424 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int s[5005], curs[5005], door[5005]; void exploreCave(int N) { fill(s, s+N, -1); for(int i = 0; i < N; ++i){ fill(curs, curs+N, 0); for(int k = 0; k < N; ++k) if(~s[k]) curs[k] = s[k]; int d = 0, state = (tryCombination(curs) >= i); // state = 0 : closed // state = 1 : open for(int j = 12; j >= 0; --j){ for(int k = d; k < min(d + (1<<j), N); ++k){ if(~s[k]) curs[k] = s[k]; curs[k] = 1; } int cstate = (tryCombination(curs) >= i); if(cstate == state) d += (1<<j); } door[d] = i; s[d] = (state ? 0 : 1); } answer(s, door); }
#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...