#include "bits/stdc++.h"
using namespace std;
#define int long long
signed main () {
int n;
cin >> n;
int l = 1, r = n+1, f = 1;
cout << "? " << 1 << endl;
int x;
cin >> x;
if(n > 64) {
return 0;
}
while(1) {
if(l==r)break;
if(f == 1) {
r --;
cout << "? " << r << endl;
cin >> x;
if(x == 0) {
assert(r-l<n);
cout << r-l+1 << endl;
return 0;
}
f = -1;
}else {
l ++;
cout << "? " << l << endl;
cin >> x;
if(x == 0) {
assert(r-l<n);
cout << r-l+1 << endl;
return 0;
}
f=1;
}
}
cout << "= 0" << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Token parameter [name=cmd] equals to "4", doesn't correspond to pattern "[?=]" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Token parameter [name=cmd] equals to "4", doesn't correspond to pattern "[?=]" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Token parameter [name=cmd] equals to "4", doesn't correspond to pattern "[?=]" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Token parameter [name=cmd] equals to "4", doesn't correspond to pattern "[?=]" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Token parameter [name=cmd] equals to "4", doesn't correspond to pattern "[?=]" |
2 |
Halted |
0 ms |
0 KB |
- |