Submission #1329427

#TimeUsernameProblemLanguageResultExecution timeMemory
1329427ezzzay커다란 상품 (IOI17_prize)C++20
Compilation error
0 ms0 KiB
#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
int find_best(int n) {
    int lo=0;hi=n-1;
    while(hi>=lo){
        int mid=(hi+lo)/2;
        std::vector<int> res = ask(mid);
        if(res[0]==1){
            hi=mid-1;
        }
        else lo=mid+1;
    }
    return lo;
}

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:5:14: error: 'hi' was not declared in this scope
    5 |     int lo=0;hi=n-1;
      |              ^~