# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
137053 | tinjyu | Hotter Colder (IOI10_hottercolder) | C++14 | 801 ms | 8288 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 <iostream>
using namespace std;
int HC(int N){
if(N==1)return 1;
long long int n=N;
int mid=n/2;
long long int l=1,r=n,a=-1,pre=n;
while(true)
{
if(l==r)return l;
Guess(r);
pre=r;
int mid=l;
long long int tmp=Guess(mid);
//cout<<l<<" "<<r<<" "<<mid<<" "<<pre<<" "<<tmp<<endl;
if(tmp==1)
{
if(pre>mid)
{
r=(mid+pre)/2;
if((mid+pre)%2==0)r--;
}
else
{
l=(mid+pre)/2+1;
}
}
if(tmp==-1)
{
if(pre>mid)
{
l=(mid+pre)/2+1;
}
else
{
r=(mid+pre)/2;
if((mid+pre)%2==0)r--;
}
}
if(tmp==0)return (mid+pre)/2;
}
}
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... |