답안 #319562

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
319562 2020-11-05T14:02:35 Z ehdtjskaqhd Hotter Colder (IOI10_hottercolder) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int HC(int N)
{
    int l = 1, r = N, res;
    while (r - l > 1)
    {
        if (lg == l) res = Guess(r);
        else if (lg == r) res = -Guess(l);
        else Guess(l), res = Guess(r);
        debug() << imie(l) << imie(r) << imie(res);
        int mid = (l + r) / 2, adj = (l + r) % 2;
        if (!res) return mid;
        else if (~res) l = mid + adj;
        else r = mid;
    }
    return res > 0 ? r : l;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:9:13: error: 'lg' was not declared in this scope; did you mean 'l'?
    9 |         if (lg == l) res = Guess(r);
      |             ^~
      |             l
hottercolder.cpp:12:9: error: 'debug' was not declared in this scope
   12 |         debug() << imie(l) << imie(r) << imie(res);
      |         ^~~~~
hottercolder.cpp:12:20: error: 'imie' was not declared in this scope
   12 |         debug() << imie(l) << imie(r) << imie(res);
      |                    ^~~~