답안 #927202

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
927202 2024-02-14T12:05:35 Z vjudge1 Hotter Colder (IOI10_hottercolder) C++11
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

int Guess(int n) {
    cout << "Guess(" << n << ")";
    int res;
    cin >> res;
    return res;
}

void HC(int n) {
    int l = 1, r = n, mid;
    int last = n;
    Guess(n);
    while(true) {
        mid = (l + r) >> 1;
        int g = Guess(mid);
        if(g == 1) {
            r = mid;
        } else if(g == -1) {
            l = mid;
        } else {
            cout << (last - mid) / 2;
            return;
        }
        last = mid;
    }
}

Compilation message

/usr/bin/ld: /tmp/ccync4zp.o: in function `Guess(int)':
grader.cpp:(.text+0x0): multiple definition of `Guess(int)'; /tmp/ccBXb0vp.o:hottercolder.cpp:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status