# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
940818 |
2024-03-07T16:47:25 Z |
LucaIlie |
Colors (BOI20_colors) |
C++17 |
|
0 ms |
344 KB |
#include <bits/stdc++.h>
using namespace std;
set<int> unused;
int query( long long c ) {
unused.erase( c );
cout << "? " << c << endl;
int ans;
cin >> ans;
return ans;
}
void answer( long long c ) {
cout << "= " << c << endl;
}
int main() {
long long n;
cin >> n;
for ( int i = 1; i <= 400; i++ )
unused.insert( i );
long long l = 0, r = n;
while ( r - l > 1 ) {
long long c = (l + r) / 2;
int x = *unused.begin();
query( x );
if ( query( c + x ) )
r = c;
else
l = c;
}
answer( r );
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Hair color 7 was used multiple times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Hair color 7 was used multiple times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Hair color 7 was used multiple times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Hair color 7 was used multiple times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Hair color 7 was used multiple times |
2 |
Halted |
0 ms |
0 KB |
- |