# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
537985 | czhang2718 | Bitaro, who Leaps through Time (JOI19_timeleap) | C++17 | 482 ms | 524288 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 P{
int l, r;
ll k;
inline P(){}
inline P(int l, int r, ll k): l(l), r(r), k(k) {}
inline friend P operator + (P a, P b){
if(a.k==-1 && b.k==-1){
if(max(a.l, b.l)<=min(a.r, b.r)) return P(max(a.l, b.l), min(a.r, b.r), -1);
if(a.l>b.r) return P(a.l, b.r, a.l-b.r);
if(a.r<b.l) return P(a.r, b.l, 0);
}
if(a.k==-1){
if(b.l>a.r) return P(a.r, b.r, b.k);
if(b.l<a.l) return P(a.l, b.r, b.k+a.l-b.l);
return b;
}
if(b.k==-1){
if(b.l>a.r) return P(a.l, b.l, a.k);
if(b.r<a.r) return P(a.l, b.r, a.k+a.r-b.r);
return a;
}
return P(a.l, b.r, a.k+b.k+max(0, a.r-b.l));
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |