제출 #701644

#제출 시각아이디문제언어결과실행 시간메모리
701644US3RN4M3Colors (BOI20_colors)C++17
0 / 100
1 ms300 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; bool ask(ll pos) { pos++; cout << "? " << pos << endl; bool res; cin >> res; return res; } main() { ll n; cin >> n; bool parity = true; ll lo = 1, hi = n; ll pos = (n - 1) / 3; ask(pos); while(lo != hi) { ll mid = (lo + hi - 1) / 2; if(parity) { pos += mid; } else { pos -= mid; } parity = !parity; if(ask(pos)) { hi = mid; } else { lo = mid + 1; } } cout << "= " << lo << endl; }

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

Colors.cpp:10:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   10 | main() {
      | ^~~~
#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...