제출 #73758

#제출 시각아이디문제언어결과실행 시간메모리
73758renatsjThe Big Prize (IOI17_prize)C++14
20 / 100
4 ms656 KiB
#include<bits/stdc++.h>
#include "prize.h"
using namespace std;
int i,j,n,m,l,r,c,xl,xr;
vector<int> aa;
int find_best(int n)
{
	l=0;
	r=n-1;
	while (l<r)
    {
        c=l+(r-l)/2;
        aa=ask(c);
        xl=aa[0];
        xr=aa[1];
        //cout << l << " " << c << " " << r << "  " << xl << " " << xr << "\n";
        if (xl+xr==0)
        {
            return c;
        }
        else
        {
            if (xl==1)
            {
                r=c-1;
            }
            else
            {
                l=c+1;
            }
        }
    }
    return l;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...