# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
276192 | Toirov_Sadi | Arranging Shoes (IOI19_shoes) | C++17 | 230 ms | 17612 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>
#include "shoes.h"
using namespace std;
const int N = 2e5 + 7;
int t[4 * N];
int lz[4 * N];
void push(int v, int tl, int tr){
if(lz[v] == 0) return;
int tm = (tl + tr) / 2;
t[v * 2] += (tm - tl + 1) * lz[v];
t[v * 2 + 1] += (tr - tm) * lz[v];
lz[v * 2] += lz[v];
lz[v * 2 + 1] += lz[v];
lz[v] = 0;
}
void upd(int v, int tl, int tr, int l, int r, int x){
if(l > r) return;
if(tl == l && tr == r){
t[v] += (tr - tl + 1) * x;
lz[v] += x;
return;
}
push(v, tl, tr);
int tm = (tl + tr) / 2;
upd(v * 2, tl, tm, l, min(tm, r), x);
upd(v * 2 + 1, tm + 1, tr, max(tm + 1, l), r, x);
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |