이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
pii query(int p) {
vector<int> res = ask(p);
return { res[0], res[1] };
}
int find_best(int n) {
//one type 1
//n-1 type 2
int l=0, r=n-1, ans=0;
while(l <= r) {
int mid = (l + r) / 2;
auto [a, b] = query(mid);
if(a == 0 && b == 0) {
ans = mid;
break;
}
if(a > 0) r = mid - 1;
else l = mid + 1;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |