Submission #650242

#TimeUsernameProblemLanguageResultExecution timeMemory
650242NintsiChkhaidzeCave (IOI13_cave)C++17
46 / 100
15 ms436 KiB
#include "cave.h" #include <iostream> #define pb push_back using namespace std; const int N = 5005; int s[N],d[N]; bool f[N]; void exploreCave(int N) { int ans=0; for (int i = 0; i < N; i++){ if (ans == N) break; int x = tryCombination(s); if (x == -1) x = 1e9; for (int j = 0; j < N; j++){ if (f[j]) continue; s[j] = 1; int x2 = tryCombination(s); if (x2==-1) x2=1e9; if (x2 != x) { f[j] = 1; ans++; d[j] = min(x2,x); if (x2 < x) { s[j] = 0; } else { x = x2; s[j] = 1; } continue; } s[j] = 0; } } answer(s,d); }
#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...