제출 #414666

#제출 시각아이디문제언어결과실행 시간메모리
414666hibye1217동굴 (IOI13_cave)C++17
100 / 100
367 ms452 KiB
#ifndef NOTSUBMIT #include <bits/stdc++.h> #include "cave.h" using namespace std; #endif // NOTSUBMIT void exploreCave(int N) { int flp[5020] = {}; int dor[5020] = {}; bool chk[5020] = {}; for (int i = 0; i < N; i++){ int st = 0, ed = N-1; int res1 = tryCombination(flp); while (st < ed){ int mid = st + ed >> 1; for (int j = st; j <= mid; j++){ if (chk[j]){ continue; } flp[j] ^= 1; } int res2 = tryCombination(flp); for (int j = st; j <= mid; j++){ if (chk[j]){ continue; } flp[j] ^= 1; } if ( (res1==i) ^ (res2==i) ){ ed = mid; } else{ st = mid+1; } } int ptr = st; dor[ptr] = i; chk[ptr] = 1; if (res1 == i){ flp[ptr] = 1; } } answer(flp, dor); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   15 |    int mid = st + ed >> 1;
      |              ~~~^~~~
#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...