Submission #727947

#TimeUsernameProblemLanguageResultExecution timeMemory
727947Elvin_FritlCave (IOI13_cave)C++17
12 / 100
9 ms340 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; void exploreCave(int n) { int v[n]; memset(v, 0, sizeof(v)); int res[n]; for(int i=0;i<n;i++){ res[i]=i; } int z=n*2,k; while(z--){ k=tryCombination(v); if(k==-1){ break; } v[k]^=1; } if(k==-1){ answer(v,res); return; } memset(v, 0, sizeof(v)); memset(res, -1, sizeof(res)); for(int i = 0; i < n; i++){ int d = tryCombination(v); if(d == -1) d = n; for (int i = 0; i < n; i++) { v[i] ^= 1; int a = tryCombination(v); if(a == -1){ d = -1; break; } if(a < d){ res[i] = a; v[i] ^= 1; } if(a > d){ res[i] = d + 1; d = a; } } if(d == n) break; } answer(v,res); }
#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...