제출 #650243

#제출 시각아이디문제언어결과실행 시간메모리
650243NintsiChkhaidze동굴 (IOI13_cave)C++17
46 / 100
10 ms400 KiB
#include "cave.h" #include <iostream> #define pb push_back using namespace std; const int N = 5005; int s[N],d[N],mx[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] || mx[j] > i) 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; } mx[j] = max(mx[j],x); 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...