답안 #851048

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
851048 2023-09-18T11:18:20 Z _Knyaz_ Guess the number (BOI20_guess) C++17
0 / 100
1 ms 596 KB
/// 18.09.2023 16:09
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n; cin >> n;
    int l = 1, r = 10;
    while(l <= r){
        int mid = (l + r) / 2;
        cout << "? " << mid << '\n';
        //cout.flush();
        int q; cin >> q;
        if(!q){ cout << "= " << mid << '\n'; return 0; }
        else if(q > 0) r = mid - 1;
        else l = mid + 1;
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 596 KB Output is correct
2 Incorrect 1 ms 340 KB Unexpected end of file - token expected
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 596 KB Output is correct
2 Incorrect 1 ms 340 KB Unexpected end of file - token expected
3 Halted 0 ms 0 KB -