#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(69420);
int HC(int N){
int l = 1, r = N;
int prv = (rng()&1 ? l : r);
Guess(prv);
while(l < r){
int tmp = Guess(prv^l^r);
if(tmp == 0)return (r+l)/2;
if(prv == r)tmp*=-1;
if(tmp == -1){
r = (r+l-1)/2;
if(prv == l && l < r)Guess(l);
prv = l;
}
else {
l = (r+l)/2 + 1;
if(prv == r && l < r)Guess(r);
prv = r;
}
}
return l;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
1440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
1444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
20 ms |
1368 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
509 ms |
16520 KB |
Output is partially correct - alpha = 0.153846153846 |