제출 #1216800

#제출 시각아이디문제언어결과실행 시간메모리
1216800mariamp1Cave (IOI13_cave)C++20
컴파일 에러
0 ms0 KiB
void exploreCave(int N) { int S[N]; int D[N]; int used[N]; for (int i = 0; i < N; ++i) { used[i] = 0; S[i] = 0; } int ts[N]; for (int door = 0; door < N; ++door) { for (int i = 0; i < N; ++i) ts[i] = 0; int result = tryCombination(ts); int rs; if (result > door || result == -1) { rs = 0; } else { rs = 1; } int lo = 0, hi = N - 1; int swind = -1; while (lo <= hi) { int mid = (lo + hi) / 2; for (int i = 0; i < N; ++i) { if (used[i]) ts[i] = S[i]; else ts[i] = rs; } for (int i = lo; i <= mid; ++i) { if (!used[i]) ts[i] = 1 - rs; } int res = tryCombination(ts); if (res > door || res == -1) { hi = mid; } else { lo = mid + 1; } if (lo == hi) { swind = lo; break; } } D[door] = swind; S[swind] = rs; used[swind] = 1; } answer(S, D); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:22: error: 'tryCombination' was not declared in this scope
   15 |         int result = tryCombination(ts);
      |                      ^~~~~~~~~~~~~~
cave.cpp:51:5: error: 'answer' was not declared in this scope
   51 |     answer(S, D);
      |     ^~~~~~