# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
287620 |
2020-08-31T21:24:44 Z |
luciocf |
popa (BOI18_popa) |
C++14 |
|
65 ms |
512 KB |
#include <bits/stdc++.h>
#include "popa.h"
using namespace std;
const int maxn = 1e3+10;
int n;
int L[maxn], R[maxn];
bool mark[maxn];
int f(int l, int r)
{
if (l > r) return -1;
for (int i = 0; i < n; i++)
{
if (!mark[i] && query(l, r, i, i))
{
mark[i] = 1;
L[i] = f(l, i-1);
R[i] = f(i+1, r);
return i;
}
}
}
void solve(int N, int *Left, int *Right)
{
n = N;
f(0, n-1);
for (int i = 0; i < n; i++)
Left[i] = L[i], Right[i] = R[i];
}
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 | }
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
512 KB |
Execution killed with signal 15 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
65 ms |
376 KB |
Execution killed with signal 15 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
376 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |