Submission #1331063

#TimeUsernameProblemLanguageResultExecution timeMemory
1331063hectormedranoHotter 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 = 1;
   R = N+1;
   while(R != L+1){
    R--;
    Guess(L);
    Guess(R);
    if(w == 0){return (L+R)/2;}
    if(w == 1){
        L = (L+R)/2 + 1;
        R++;
    }
    if(w == -1){
        R = (L+R+1)/2;
    }
   }
   return L;
}

Compilation message (stderr)

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:18:8: error: 'w' was not declared in this scope
   18 |     if(w == 0){return (L+R)/2;}
      |        ^
hottercolder.cpp:19:8: error: 'w' was not declared in this scope
   19 |     if(w == 1){
      |        ^
hottercolder.cpp:23:8: error: 'w' was not declared in this scope
   23 |     if(w == -1){
      |        ^