제출 #1135041

#제출 시각아이디문제언어결과실행 시간메모리
1135041lopkusColors (BOI20_colors)C++20
0 / 100
0 ms436 KiB
#include<bits/stdc++.h> using namespace std; int ask(int n) { cout << "! " << n; cout << endl; int x; cin >> x; return x; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; if(n <= 64) { ask(1); int l = 1, r = n, p = 0, c = - 1; while(l <= r) { if(!p) { int u = ask(r); if(!u) { break; } c = r - l; l += 1; } else { int u = ask(l); if(!u) { break; } c = r - l; r -= 1; } p ^= 1; } cout << "= " << c; } }
#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...