# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
858735 |
2023-10-09T05:50:42 Z |
maks007 |
Colors (BOI20_colors) |
C++14 |
|
0 ms |
436 KB |
#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;
set <int> s;
for(int i = 0; i < n; i ++) s.insert(i+1);
s.erase(1);
if(n > 64) {
return 0;
}
while(1) {
if(l+1>=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;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
OK (5 queries) |
2 |
Correct |
0 ms |
436 KB |
OK (6 queries) |
3 |
Correct |
0 ms |
344 KB |
OK (10 queries) |
4 |
Incorrect |
0 ms |
344 KB |
Integer parameter [name=k] equals to 0, violates the range [1, 26] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
OK (5 queries) |
2 |
Correct |
0 ms |
436 KB |
OK (6 queries) |
3 |
Correct |
0 ms |
344 KB |
OK (10 queries) |
4 |
Incorrect |
0 ms |
344 KB |
Integer parameter [name=k] equals to 0, violates the range [1, 26] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
OK (5 queries) |
2 |
Correct |
0 ms |
436 KB |
OK (6 queries) |
3 |
Correct |
0 ms |
344 KB |
OK (10 queries) |
4 |
Incorrect |
0 ms |
344 KB |
Integer parameter [name=k] equals to 0, violates the range [1, 26] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
OK (5 queries) |
2 |
Correct |
0 ms |
436 KB |
OK (6 queries) |
3 |
Correct |
0 ms |
344 KB |
OK (10 queries) |
4 |
Incorrect |
0 ms |
344 KB |
Integer parameter [name=k] equals to 0, violates the range [1, 26] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
OK (5 queries) |
2 |
Correct |
0 ms |
436 KB |
OK (6 queries) |
3 |
Correct |
0 ms |
344 KB |
OK (10 queries) |
4 |
Incorrect |
0 ms |
344 KB |
Integer parameter [name=k] equals to 0, violates the range [1, 26] |
5 |
Halted |
0 ms |
0 KB |
- |