제출 #29823

#제출 시각아이디문제언어결과실행 시간메모리
29823Nikefor동굴 (IOI13_cave)C++98
13 / 100
33 ms512 KiB
#include "cave.h" void exploreCave(int N) { int S[N], D[N]; for(int i=0; i<N; i++) { S[i] = 0; D[i] = -1; } if(tryCombination(S)==-1) { for(int i=0; i<N; i++) { S[i] = 1; int d = tryCombination(S); D[i] = d; S[i] = 0; } answer(S, D); return; } else if(N<=100) { int d = tryCombination(S); while(d!=-1) { for(int i=0; i<N; i++) { if(D[i]!=-1) continue; S[i] = 1; int t = tryCombination(S); if(t<d) D[i] = t; if(t>d) { D[i] = d; break;} S[i] = 0; } d = tryCombination(S); } for(int i=0; i<N; i++) { if(D[i]!=-1) continue; S[i] = (S[i]+1)%2; D[i] = tryCombination(S); S[i] = (S[i]+1)%2; } answer(S, D); return; } for(int i=0; i<N; i++) D[i] = i; for(int i=0; i<N; i++) { if(tryCombination(S)==i) S[i] = 1; } 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...