Submission #1331058

#TimeUsernameProblemLanguageResultExecution timeMemory
1331058hectormedranoHotter Colder (IOI10_hottercolder)C++20
0 / 100
468 ms62628 KiB
#include <bits/stdc++.h>
#include "grader.h"
//#include "hottercolder.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;

int HC(int N){
   ll L, R;
   L = 0;
   R = N+1;
   while(R - L > 2){
    ll M = (L+R)/2;
    Guess(M-1);
    ll w = Guess(M+1);
    if(w == 0){return M;}
    if(w == 1){L = M;}
    if(w == -1){R = M;}
   }
   if(L==0){
    Guess(L+1);
    ll w = Guess(L+2);
    if(w == 1){return L+2;}
    if(w == -1){return L+1;}
   }
   if(R==N+1){
    Guess(R-1);
    ll w = Guess(R-2);
    if(w == 1){return R-2;}
    if(w == -1){return R-1;}
   }
   return L;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...