# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
73658 |
2018-08-28T16:27:07 Z |
yusufake |
popa (BOI18_popa) |
C++11 |
|
2 ms |
500 KB |
#include<bits/stdc++.h>
using namespace std;
#include "popa.h"
#define _ int v, int tl, int tr, int l, int r
#define tm (tl+tr >> 1)
#define sol v+v,tl,tm,l,r
#define sag v+v+1,tm+1,tr,l,r
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define pp pair<int,int>
const int mod = 1e9 + 7;
const int N = 1e3 + 3;
int L[N],R[N];
int f(int l, int r, int *lef, int *rig){
if(l > r) return -1;
int i;
for(i=l;i<=r;i++)
if(L[i] < l && R[i] > r)
break;
lef[i] = f(l,i-1,lef,rig);
rig[i] = f(i+1,r,lef,rig);
return i;
}
stack < int > S;
int solve(int n, int *lef, int *rig){
int i;
for(i=0;i<n;i++){
for(; S.size() && query(S.top(),i,i,i) ;){
R[ S.top() ] = i;
S.pop();
}
L[i] = S.size() ? -1 : S.top();
S.push(i);
}
for(; S.size() ;){
R[ S.top() ] = n;
S.pop();
}
return f(0,n-1,lef,rig);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
376 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
500 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
500 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |