# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1088089 | StefanSebez | Hotter Colder (IOI10_hottercolder) | C++14 | 733 ms | 24400 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;
#define fi first
#define se second
#define pb push_back
#define ll long long
#define ld long double
int HC(int n){
//for(int i=1;i<=50;i++){for(int j=1;j<=i;j++) printf("%i %i\n",i,j);}
int l=1,r=n,ct=0,res=0;
vector<pair<int,int> >a;
while(l<=r){
//printf("%i %i\n",l,r);
if(l==r){res=l;break;}
int mid=l+r>>1;
if(ct%2==0 || r-l<=3){
a.pb({Guess(mid),mid});
a.pb({Guess(mid+1),mid+1});
if(a.back().fi==-1) r=mid;
else l=mid+1;
}
else{
if(a.back().se<=mid){
int k=(r-l+1)/4;
mid=l+3*k;
//printf("%i\n",mid);
a.pb({Guess(mid),mid});
int sledeci=l+mid>>1;
if(a.back().fi==1) l=sledeci;
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... |