# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
563034 | amunduzbaev | Arranging Tickets (JOI17_arranging_tickets) | C++17 | 48 ms | 12756 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 ar array
#define int long long
const int N = 2e5 + 5;
struct ST{
int tree[N << 2], P[N << 2];
void flush(){
memset(tree, 0, sizeof tree);
memset(P, 0, sizeof P);
}
void push(int x, int lx, int rx){
if(lx == rx) return;
tree[x<<1] += P[x], P[x<<1] += P[x];
tree[x<<1|1] += P[x], P[x<<1|1] += P[x];
P[x] = 0;
}
void add(int l, int r, int v, int lx = 0, int rx = N, int x = 1){
if(lx > r || rx < l) return;
if(lx >= l && rx <= r){
tree[x] += v, P[x] += v;
return;
} int m = (lx + rx) >> 1;
push(x, lx, rx);
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |