# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
227326 | wilwxk | Triple Jump (JOI19_jumps) | C++14 | 1428 ms | 54976 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;
typedef long long ll;
struct st_node {
ll mxv, mx;
ll lz;
};
const int MAXN = 5e5+5;
const ll INF = 1e18;
int input[MAXN];
vector<tuple<int, int, int> > qv; //{r, l, id}
vector<tuple<int, int, int> > jumps; //{r, l, val}
st_node seg[MAXN*4];
ll ans[MAXN];
int n, q;
void st_process() {
stack<int> st;
input[0] = 2e9;
st.push(0);
for(int i = 1; i <= n; i++) {
while(input[st.top()] < input[i]) st.pop();
if(st.top() != 0) {
int id = st.top();
jumps.push_back({ i+i-id, id, input[i]+input[id] });
}
st.push(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... |