# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
498883 | MohamedFaresNebili | Railway (BOI17_railway) | C++14 | 450 ms | 40960 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;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
ll n, m, k; vector<ll> adj[2 * 100005];
ll dep[2 * 100005], par[2 * 100005][20], tin[2 * 100005];
ll heavy[2 * 100005], top[2 * 100005], sz[2 * 100005];
ll st[6 * 100005], lazy[6 * 100005], timer;
void prop(ll v, ll l, ll r) {
if(l == r || lazy[v] == 0) return;
lazy[v * 2] += lazy[v], lazy[v * 2 + 1] += lazy[v];
ll md = (l + r) / 2;
ll a = md - l + 1, b = r - md;
st[v * 2] += lazy[v] * a, st[v * 2 + 1] += lazy[v] * b;
lazy[v] = 0;
}
void update(ll v, ll l, ll r, ll lo, ll hi) {
prop(v, l, r);
if(l > hi || r < lo) return;
if(l >= lo && r <= hi) {
# | 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... |