This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "prize.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cassert>
using namespace std;
#define rep(i,n)for (int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define _1 first
#define _2 second
#define INF 1145141919
typedef pair<int, int> P;
int find_best(int N) {
int lo = 0, hi = N-1;
while (hi-lo>=1) {
int mid = (lo+hi)/2;
vector<int> ret = ask(mid);
if (ret[0]+ret[1] == 0) return mid;
if (ret[0]>0) hi = mid-1;
else lo = mid+1;
}
return lo;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |