# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151845 | davitmarg | Hotter Colder (IOI10_hottercolder) | C++17 | 773 ms | 8216 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.
/*DavitMarg*/
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <iomanip>
#include <stack>
#include <cassert>
#include <iterator>
#include <bitset>
#include <fstream>
#define mod 1000000007ll
#define LL long long
#define LD long double
#define MP make_pair
#define PB push_back
#define all(v) v.begin(),v.end()
using namespace std;
#ifndef death
#include "grader.h";
#endif
#ifdef death
int Guess(int a)
{
cout<<"! "<<a<<endl;
int res;
cin>>res;
return res;
}
#endif
int HC(int n)
{
int l=1;
int r=n;
int m;
int ans;
while(l<=r)
{
m=(l+r)/2;
if(l==r)
{
ans=m;
break;
}
Guess(l);
int res=Guess(r);
if(res==0)
{
ans=m;
break;
}
if(res==1)
l=m+1;
else
r=m-1+(r-l)%2;
}
return ans;
}
#ifdef death
int main()
{
cout<<HC(6)<<endl;
return 0;
}
#endif
/*
*/
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... |