#include<bits/stdc++.h>
#include "grader.h"
using namespace std;
int HC(int nn)
{
int ls1 = 0;
int l = 1 , r = nn;
while( l < r ){
int m = (l + r) / 2;
int y2 = Guess( m + 1 );
if( y2 == -1 && ls1 == l - 1 && (l > 1 || r < nn) ){
r = m;
ls1 = m + 1;
continue;
}
if( y2 == -1 && (ls1 == r || ls1 == r + 1) ){
l = m + 1;
ls1 = m + 1;
continue;
}
int y1 = Guess( m );
ls1 = m;
if( y1 == -1 )l = m + 1;
else r = m;
}
return l;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
28 ms |
1280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
29 ms |
1280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
28 ms |
1400 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
728 ms |
8376 KB |
Output isn't correct - alpha = 0.000000000000 |