Submission #851052

# Submission time Handle Problem Language Result Execution time Memory
851052 2023-09-18T11:25:15 Z _Knyaz_ Guess the number (BOI20_guess) C++17
0 / 100
0 ms 428 KB
/// 18.09.2023 16:09
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n; cin >> n;
    int l = 1, r = 50;
    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;
    }
}
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 428 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 428 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -