Submission #754495

# Submission time Handle Problem Language Result Execution time Memory
754495 2023-06-07T22:02:36 Z ValiAntonie Hotter Colder (IOI10_hottercolder) C++14
Compilation error
0 ms 0 KB
#include "grader.h"
#include<bits/stdc++.h>
using namespace std;
 
 
int HC(int n){
    int st = 1;
    int dr = n;
    while(st <= dr){
        int mij = (st + dr) / 2;
        if(x == 0)
            return mij;
        else if(x == 1){
            st = mij + 1;
            Guess(st);
            int x = Guess(dr);
        }
        else if(x == -1){
            dr = mij;
            Guess(st);
            int x = Guess(dr);
        }
    }
    return st;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:11:12: error: 'x' was not declared in this scope
   11 |         if(x == 0)
      |            ^
hottercolder.cpp:16:17: warning: unused variable 'x' [-Wunused-variable]
   16 |             int x = Guess(dr);
      |                 ^
hottercolder.cpp:21:17: warning: unused variable 'x' [-Wunused-variable]
   21 |             int x = Guess(dr);
      |                 ^