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<bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef pair<long long, long long> pll;
typedef pair<char, int> ci;
typedef pair<string, int> si;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
#define pb push_back
#define fi first
#define se second
#define whole(v) v.begin(), v.end()
#define rwhole(v) v.rbegin(), v.rend()
#define inf INT_MAX/2
#define fro front
int find_best(int n) {
int lo = -1;
int hi = n+1;
int mid;
int b = 1;
while(b){
mid = lo + (hi - lo)/2;
vector<int> x = ask(mid);
if(x[0] == 0 && x[1] == 0){
b = 0;
continue;
}
if(x[0] > 0){
hi = mid;
}else if(x[1] > 0){
lo = mid;
}
}
return mid;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |