제출 #29841

#제출 시각아이디문제언어결과실행 시간메모리
29841ozaslan동굴 (IOI13_cave)C++14
0 / 100
221 ms588 KiB
#include "cave.h" #define max_N 5005 int kul[max_N], S[max_N], D[max_N]; void exploreCave(int N) { for (int i = 0; i < N; i++) { int kapi = tryCombination(S); if (kapi == -1) { for (int j = 0; j < N; j++) if (!kul[j]) { S[j] = 1; kapi = tryCombination(S); if (kapi == i) { S[j] = 0; D[j] = i; kul[j] = 1; break; } else S[j] = 0; } } else if (kapi > i) for (int j = 0; j < N; j++) if (!kul[j]) { S[j] = 1; kapi = tryCombination(S); if (kapi == i) { S[j] = 0; D[j] = i; kul[j] = 1; break; } else S[j] = 0; } else for (int j = 0; j < N; j++) if (!kul[j]) { S[j] = 1; kapi = tryCombination(S); if (kapi > i || kapi == -1) { D[j] = i; kul[j] = 1; break; } else S[j] = 0; } } answer(S, D); }

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:26:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
   else if (kapi > i)
           ^
#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...