답안 #319564

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
319564 2020-11-05T14:04:51 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, lg = -1;
    auto gs = [&](int g) -> int {return Guess(lg = g);};
    while (r - l > 1)
    {
        if (lg == l) res = gs(r);
        else if (lg == r) res = -gs(l);
        else gs(l), res = gs(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:13:9: error: 'debug' was not declared in this scope
   13 |         debug() << imie(l) << imie(r) << imie(res);
      |         ^~~~~
hottercolder.cpp:13:20: error: 'imie' was not declared in this scope
   13 |         debug() << imie(l) << imie(r) << imie(res);
      |                    ^~~~