# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1012399 | huutuan | Hotter Colder (IOI10_hottercolder) | C++14 | 640 ms | 8240 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(69420);
int HC(int N){
int l=1, r=N;
int cnt=0;
int lst=0;
while (l<=r){
int mid=(l+r)>>1;
if (l==r) return mid;
int t=0;
if (lst==l){
t=Guess(r); lst=r;
}else if (lst==r){
t=-Guess(l); lst=l;
}else if (uniform_int_distribution<int>(0, 1)(rng)){
Guess(l);
t=Guess(r);
lst=r;
}else{
Guess(r);
t=-Guess(l);
lst=l;
}
if (!t) return mid;
if (t==1) l=mid+1;
else r=mid;
}
return -1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |