#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
int HC( int n ){
Guess( 1 );
int l = 1, r = n, prev = 1;
while( l < r ) {
int now = Guess( r );
if( now == 0 ) return ( r + prev ) / 2;
else if( now == 1 ) {
int mid = ( l + r ) / 2;
if( ( l + r ) % 2 ) mid++;
prev = r, l = mid;
}
else {
int mid = ( l + r ) / 2;
if( ( l + r ) % 2 == 0 ) mid--;
prev = l, r = mid;
}
}
return l;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
43 ms |
17784 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
46 ms |
17784 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
48 ms |
17784 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
676 ms |
140428 KB |
Output isn't correct - alpha = 0.000000000000 |