제출 #571992

#제출 시각아이디문제언어결과실행 시간메모리
571992Vanilla동굴 (IOI13_cave)C++17
0 / 100
84 ms404 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; void exploreCave(int n) { int s[n], dr[n]; for (int i = 0; i < n; i++){ s[i] = 0, dr[i] = -1; } for (int door = 0; door < n; door++){ for (int i = 0; i < n; i++){ if (dr[i] == -1) { s[i] = 0; } } int l = 0, r = n-1, state = 1, k = tryCombination(s); int rs = 0; while (l <= r) { for (int i = l; i <= r; i++){ if (dr[i] == -1) s[i] = 0; } int mid = (l + r) / 2; for (int i = l; i <= mid; i++){ if (dr[i] == -1) dr[i] = 1; } k = tryCombination(s); if(k == door) { r = mid; state = !state; }else { l = mid + 1; } } dr[l] = door; s[l] = state; } answer(s, dr); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:17:13: warning: unused variable 'rs' [-Wunused-variable]
   17 |         int rs = 0;
      |             ^~
#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...