Submission #131275

#TimeUsernameProblemLanguageResultExecution timeMemory
131275dragonslayeritHotter Colder (IOI10_hottercolder)C++14
0 / 100
800 ms136280 KiB
#include "grader.h"

int HC(int N){
  Guess(1);
  int low=1,high=N;
  while(true){
    if(low==high) return low;
    int g=Guess(high);
    if(g==0) return (low+high)/2;
    if(g>0){
      low=(low+high)/2+1;
    }else{
      high=(low+high-1)/2;
    }
    if(low==high) return low;
    g=Guess(low);
    if(g==0) return (low+high)/2;
    if(g<0){
      low=(low+high)/2+1;
    }else{
      high=(low+high-1)/2;
    }
  }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...