답안 #598635

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
598635 2022-07-18T15:38:33 Z Mounir Hotter Colder (IOI10_hottercolder) C++14
컴파일 오류
0 ms 0 KB
#include "grader.h"
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define chmax(x, v) x = max(x, v)
#define chmin(x, v) x = min(x, v)
#define pb push_back
#define pii pair<int, int>
#define sz(x) (int)x.size()
#define x first
#define y second
//#define int long long
using namespace std;


int HC(int N){
      int l = 1, r = N, prev = (l + r)/2 + 1;
      int ans = Guess(prev);
      while (r > l){
            int mid = (l + r)/2;
            int delta = prev - mid;
            int mtn = mid - delta;
            if (mtn < 1 || mtn > N){
                  Guess(mid - 1);
                  prev = mid - 1;
                  continue;
            }
      /*      cout << l << " " << r << " " << mid << endl;
            cout << prev << " " << mtn << endl;*/
            ans = Guess(mtn);
            if ((ans >= 0)^(prev > mtn))
                  l = mid;
            else
                  r = mid - 1;
            prev = mtn;
      }
      return l;
}

signed main(){ 
      int N; cin >> N;
      cout << HC(N) << endl;
      return 0;   
}

Compilation message

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