Submission #1331059

#TimeUsernameProblemLanguageResultExecution timeMemory
1331059hectormedranoHotter Colder (IOI10_hottercolder)C++20
Compilation error
0 ms0 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;}
   }
   Guess(L);
   ll w = Guess(R);
   if(w == 0){return L+1;}
   if(w == 1){return R;}
   if(w == -1){return L;}
}

Compilation message (stderr)

hottercolder.cpp:2:2: error: stray '#' in program
    2 | /#include "grader.h"
      |  ^
hottercolder.cpp:2:1: error: expected unqualified-id before '/' token
    2 | /#include "grader.h"
      | ^
hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:16:5: error: 'Guess' was not declared in this scope
   16 |     Guess(M-1);
      |     ^~~~~
hottercolder.cpp:23:5: error: 'Guess' was not declared in this scope
   23 |     Guess(L+1);
      |     ^~~~~
hottercolder.cpp:29:5: error: 'Guess' was not declared in this scope
   29 |     Guess(R-1);
      |     ^~~~~
hottercolder.cpp:34:4: error: 'Guess' was not declared in this scope
   34 |    Guess(L);
      |    ^~~~~
hottercolder.cpp:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^