이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "prize.h"
using namespace std;
using ll = long long;
using ii = pair<ll, ll>;
using vi = vector<ll>;
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define lb lower_bound
#define ub upper_bound
int find_best(int n) {
int lo = 0, hi = n - 1;
while(lo <= hi) {
int md = (lo + hi) / 2;
vector<int> res = ask(md);
if(res[0] + res[1] == 0) return md;
if(res[0] > res[1] && md != n - 1) lo = md + 1;
else if(res[0] < res[1] && md != 0) hi = md - 1;
if(md == 0) lo = md + 1;
else if(md == n - 1) hi = md - 1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |