# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1089930 |
2024-09-17T12:10:14 Z |
lucri |
popa (BOI18_popa) |
C++17 |
|
224 ms |
968 KB |
#include<bits/stdc++.h>
int query(int a,int b,int c,int d);
int rezolva(int b,int e,int* Left,int* Right)
{
if(b>e)
return -1;
if(b==e)
{
Left[b]=Right[b]=-1;
return b;
}
int cb=b,ce=e;
while(b<=e)
{
int mid=(b+e)/2;
if(query(cb,mid,cb,ce)==1)
e=mid-1;
else
b=mid+1;
}
Left[b]=rezolva(cb,b-1,Left,Right);
Right[b]=rezolva(b+1,ce,Left,Right);
return b;
}
int solve(int N, int* Left, int* Right)
{
return rezolva(0,N-1,Left,Right);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
432 KB |
Output is correct |
2 |
Correct |
11 ms |
344 KB |
Output is correct |
3 |
Correct |
6 ms |
344 KB |
Output is correct |
4 |
Correct |
10 ms |
432 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
170 ms |
968 KB |
Output is correct |
2 |
Correct |
224 ms |
676 KB |
Output is correct |
3 |
Correct |
83 ms |
676 KB |
Output is correct |
4 |
Correct |
124 ms |
956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
34 ms |
428 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |