# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
762949 | vjudge1 | Just Long Neckties (JOI20_ho_t1) | C++17 | 110 ms | 12552 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 int long long
#define st first
#define nd second
const int maxn = 2e5 + 5;
int ans[maxn], b[maxn], st[maxn * 4], n;
pair<int, int> a[maxn];
void build(int id, int l, int r){
if(l == r){
st[id] = max(a[l + 1].st - b[l], 0ll);
return;
}
int m = (l + r) >> 1;
build(id * 2, l, m);
build(id * 2 + 1, m + 1, r);
st[id] = max(st[id * 2], st[id * 2 + 1]);
}
void update(int id, int l, int r, int pos){
if(l > pos || r < pos)
return;
if(l == r){
st[id] = max(a[l].st - b[l], 0ll);
return;
}
int m = (l + r) >> 1;
update(id * 2, l, m, pos);
update(id * 2 + 1, m + 1, r, pos);
st[id] = max(st[id * 2], st[id * 2 + 1]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |