Submission #727949

#TimeUsernameProblemLanguageResultExecution timeMemory
727949Elvin_FritlCave (IOI13_cave)C++17
34 / 100
17 ms392 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]; 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; } if(tryCombination(v)==-1){ answer(v,res); } memset(v, 0, sizeof(v)); 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; } 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...