#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define fastio ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define forn(i, a, b) for (int i=a; i<b; i++)
#define fore(i, a, b) for (int i=a; i<=b; i++)
typedef vector<int> vi;
void fast_io() {
fastio;
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
}
signed main()
{
fast_io();
int t;
cin >> t;
int n, q, m, l = 0, r; cin >> n;
int c = 0;
r = n;
while (c == 0) {
if (l == r) c = r;
m = (l + r) / 2;
cout << '?' << m << endl;
cin >> q;
if (q) r = m;
else l = m + 1;
}
cout << "= " << c << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1 ms |
200 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1 ms |
200 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1 ms |
200 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1 ms |
200 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1 ms |
200 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |