제출 #386980

#제출 시각아이디문제언어결과실행 시간메모리
386980Carmel_Ab1커다란 상품 (IOI17_prize)C++17
20 / 100
2 ms492 KiB
#include <bits/stdc++.h>
#include "prize.h"
//#include "grader.cpp"
using namespace std;
typedef long long ll;
typedef vector<ll>vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vpl;
typedef vector<int> vi;

#define all(x) x.begin(),x.end()
#define print(x) {for(auto it:x) cout << it << " " ;cout << "\n";}
#define out(x) {cout << x << "\n"; return;}
#define GLHF ios_base::sync_with_stdio(false); cin.tie(NULL)

int find_best(int n){
    int l=0,r=n-1,ans=-1;

    while(l<=r){
        int m=(l+r)/2;
        vi res=ask(m);
        if(!res[0] && !res[1])return m;
        if(res[0]){
            ans=m;
            r=m-1;
        }
        else
            l=m+1;
    }
    return ans;

}
/*
8
2 2 2 1 2 2 2 2
 */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...