제출 #1329432

#제출 시각아이디문제언어결과실행 시간메모리
1329432ezzzay커다란 상품 (IOI17_prize)C++20
0 / 100
26 ms412 KiB
#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
int find_best(int n) {
    vector<int>v=ask(0);
    int l=v[0]+v[1];
    int x=0;
    while(l!=0){
        vector<int>v=ask(x);
        if(v[0]){ 
            x/=2;
        }
        else{ // baruun taldaa baigaa
            x= (n-1+x)/2;
        }
        v=ask(x);
        l=v[0]+v[1];
    }
    return x;
}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...