# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
218026 | manh9203 | Bitaro, who Leaps through Time (JOI19_timeleap) | C++17 | 777 ms | 91188 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;
#define ll long long
const int N = 3e5 + 5;
int n, q, L[2][N], R[2][N];
struct node{
ll l, r, pos, cost;
} st[2][4 * N];
node merge(node a, node b){
node res;
if(a.l == a.r){
if(b.l == b.r){
res.l = res.r = a.l;
res.pos = b.pos;
res.cost = a.cost + b.cost + max(0LL, a.pos - b.l);
} else {
res.l = res.r = a.l;
res.pos = min(b.r, max(b.l, a.pos));
res.cost = a.cost + b.cost + max(0LL, a.pos - b.r);
}
} else {
if(b.l == b.r){
if(a.r < b.l){
res.l = res.r = a.r;
res.pos = b.pos;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |