Submission #727951

#TimeUsernameProblemLanguageResultExecution timeMemory
727951Elvin_FritlCave (IOI13_cave)C++17
21 / 100
55 ms392 KiB
#include<bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int n) { int v[n],d[n],s[n]; memset(v, 0, sizeof v); memset(d, 0, sizeof d); memset(s, 0, sizeof s); if(tryCombination(d) == -1 && n > 100){ for(int i = 0; i < n; i++){ d[i] = 1; s[i] = tryCombination(s); d[i] = 0; } answer(d, s); return; } for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ if(!v[j]){ d[j] = 0; } } int x = tryCombination(d), what = 0; if(x == i) what = 1; for(int j = 0; j < n; j++){ if(!v[j]){ d[j] = !what; } } for(int j = 0; j < n; j++){ if(!v[j]){ d[j] = what; int ii = tryCombination(d); if(ii == -1 or ii > i){ s[j] = i; v[j] = 1; break; } d[j] = !what; } } } answer(d, s); }
#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...