# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
145027 |
2019-08-18T12:53:06 Z |
MKopchev |
popa (BOI18_popa) |
C++14 |
|
41 ms |
424 KB |
#include<bits/stdc++.h>
#include<popa.h>
using namespace std;
stack<int> open,idle;
int solve(int N, int* Left, int* Right)
{
for(int i=0;i<N;i++)
{
int prev=-1;
while(open.size()&&query(open.top(),i,i,i))
{
prev=open.top();
open.pop();
}
Left[i]=prev;
open.push(i);
}
open=idle;
for(int i=N-1;i>=0;i--)
{
int prev=-1;
while(open.size()&&query(i,open.top(),i,i))
{
prev=open.top();
open.pop();
}
Right[i]=prev;
open.push(i);
}
set<int> seen={};
for(int i=0;i<N;i++)
{
seen.insert(Left[i]);
seen.insert(Right[i]);
}
for(int i=0;i<N;i++)
if(seen.count(i)==0)return i;
assert(0==1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
376 KB |
invalid argumen |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
41 ms |
424 KB |
not a valid binary tre |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
23 ms |
248 KB |
too many querie |
2 |
Halted |
0 ms |
0 KB |
- |