#include "grader.h"
#include <bits/stdc++.h>
#define rando mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
using namespace std;
int HC(int N){
if(N==1)return 1;
if(N==2){
Guess(1);
if(Guess(2)==1)return 2;
return 1;
}
int l=1,r=N,a,b,B,med,h;
while((r-l+1)>3){
a=l+(r-l)/3,b=r-(r-l)/3;
med=(a+b)>>1;
Guess(a),B=Guess(b);
if(!B)return (a+b)/2;
if(B==1)l=med+1;
else r=med-(!((a+b)&1));
}
Guess(l),h=Guess(r);
if(!h)return l+1;
else if(h==1)return r;
return l;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
1400 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
25 ms |
1376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
1280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
842 ms |
8184 KB |
Output is partially correct - alpha = 0.068965517241 |