Submission #637976

# Submission time Handle Problem Language Result Execution time Memory
637976 2022-09-03T19:16:59 Z mannshah1211 Colors (BOI20_colors) C++14
0 / 100
0 ms 208 KB
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
 
int main(){
  ll n;
  cin >> n;
  
  ll lo = 1, hi = n, mid = -1;
  while(lo <= hi){
    mid = (lo + hi)/2;
    cout << "?" << ' ' << mid << endl;
    ll x;
    cin >> x;
    
    if(x == 1){
      hi = mid - 1;
    } else{
      lo = mid + 1;
    }
  }
  
  cout << "=" << ' ' << mid;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Wrong guess
2 Halted 0 ms 0 KB -