#include "popa.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int N, *L, *R;
int qquery(int l1, int r1, int l2, int r2)
{
return query(l1-1, r1-1, l2-1, r2-1);
}
int f(int l, int r)
{
if(l==r) return l;
if(l>r) return -1;
for(int i=l; i<=r; i++)
{
if(qquery(l, r, i, i))
{
L[i]=f(l, i-1)-1;
R[i]=f(i+1, r)-1;
return i;
}
}
}
int solve(int _N, int *_L, int *_R)
{
N=_N; L=_L; R=_R;
return f(1, N)-1;
}
Compilation message
popa.cpp: In function 'int f(int, int)':
popa.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
29 | }
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
3 ms |
364 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
45 ms |
500 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
20 ms |
364 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |