//#include "hottercolder.h"
#include "grader.h"
#include <algorithm>
using namespace std;
int HC(int N){
//int g = Guess(1);
int lo=1;
int hi=N;
int lastguess=1;
Guess(lastguess);
int lmid;
int rmid;
int res;
while (lo<hi) {
lmid=lastguess;
rmid=hi-lastguess+lo;
res=Guess(rmid);
lastguess=rmid;
if (rmid<lmid) {
swap(rmid,lmid);
res=-res;
}
if (res==0) return (lmid+rmid)>>1;
if (res<0) {
//lmid side
hi=((lmid+rmid)>>1)-((rmid-lmid+1)%2);
} else {
//rmid side
lo=((lmid+rmid)>>1)+1;
}
}
return lo;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
103 ms |
53880 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
106 ms |
53880 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
108 ms |
53964 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2255 ms |
262144 KB |
Output isn't correct - alpha = 0.000000000000 |