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<bits/stdc++.h>
#include "popa.h"
#define st first
#define nd second
#define pb push_back
#define ppb pop_back
#define umax(x,y) x=max(x,y)
#define umin(x,y) x=min(x,y)
#define ll long long
#define ii pair<int,int>
#define iii pair<ii,int>
#define sz(x) (x.size())
#define orta ((bas+son)>>1)
#define all(x) x.begin(),x.end()
#define dbgs(x) cerr<<(#x)<<" --> "<<(x)<<" "
#define dbg(x) cerr<<(#x)<<" --> "<<(x)<<endl;getchar()
#define pw(x) (1<<(x))
#define inf 2000500000
#define MOD 1000000007
//#define N 305
#define LOG 20
using namespace std;
int Solve(int x,int y,int *Left,int *Right) {
if(x>y) return -1;
int bas=x,son=y;
while(bas<=son) {
if(query(bas,orta,x,y)) son=orta-1;
else bas=orta+1;
}
Left[bas]=Solve(x,bas-1,Left,Right);
Right[bas]=Solve(bas+1,y,Left,Right);
return bas;
}
int solve(int N, int* Left, int* Right) {
return Solve(0,N-1,Left,Right);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |