답안 #713193

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
713193 2023-03-21T09:42:59 Z Aaryan1378 Colors (BOI20_colors) C++14
0 / 100
0 ms 208 KB
#include <bits/stdc++.h>

using namespace std;

void solve(long long int left, long long int right) {
  if(left >= right) {
    cout << "=" << " " << left << endl;
    return;
  }
  long long int mid = (left + right) / 2;
  cout << "?" << " " << mid << endl;
  long long int ans;
  cin >> ans;
  if(ans == 1) {
    solve(left, mid + 1);
  } else {
    solve(mid + 1, right);
  }
}

int main() {
  //your code goes here
  long long int n;
  cin >> n;
  solve(1, n);
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Hair color 4 was used multiple times
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Hair color 4 was used multiple times
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Hair color 4 was used multiple times
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Hair color 4 was used multiple times
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Hair color 4 was used multiple times
2 Halted 0 ms 0 KB -