# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
25970 | tlwpdus | Cake (CEOI14_cake) | C++98 | 446 ms | 11460 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
vector<int> lst, rst;
int value[250100];
int ord[750100];
int pre[750100];
int n, q, a, maxv;
int arr[250100];
int getbef(int idx) {
if (pre[idx]==-1||~ord[pre[idx]]) return pre[idx];
return pre[idx] = (getbef(pre[idx]));
}
vector<int> comp;
void com(int arr[], int val[]) {
int i;
for (i=0;i<n;i++) comp.push_back(arr[i]);
sort(comp.begin(),comp.end());
for (i=0;i<n;i++) val[i] = lower_bound(comp.begin(),comp.end(),arr[i])-comp.begin();
}
void push(vector<int> &st, int val) {
if (st.empty()||value[st.back()]<value[val]) st.push_back(val);
}
void deb() {
int i;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |