# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
380846 |
2021-03-23T09:43:34 Z |
VodkaInTheJar |
popa (BOI18_popa) |
C++14 |
|
331 ms |
508 KB |
#include <bits/stdc++.h>
#include "popa.h"
using namespace std;
int attach(int root, int ver, int *left, int *right)
{
if (root == -1)
{
left[ver] = -1;
right[ver] = -1;
return ver;
}
if (query(root, ver, ver, ver))
{
left[ver] = root;
right[ver] = -1;
return ver;
}
right[root] = attach(right[root], ver, left, right);
return root;
}
int solve(int n, int *left, int *right)
{
left[0] = right[0] = -1;
int root = 0;
for (int i = 1; i < n; i++)
root = attach(root, i, left, right);
return root;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
33 ms |
364 KB |
Output is correct |
2 |
Correct |
98 ms |
364 KB |
Output is correct |
3 |
Correct |
18 ms |
364 KB |
Output is correct |
4 |
Correct |
44 ms |
364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
331 ms |
508 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
24 ms |
364 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |