#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);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
248 KB |
Output is correct |
2 |
Correct |
30 ms |
308 KB |
Output is correct |
3 |
Correct |
14 ms |
392 KB |
Output is correct |
4 |
Correct |
19 ms |
392 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
278 ms |
540 KB |
Output is correct |
2 |
Correct |
320 ms |
636 KB |
Output is correct |
3 |
Correct |
169 ms |
672 KB |
Output is correct |
4 |
Correct |
294 ms |
672 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
17 ms |
672 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |