# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1090207 | efishel | Synchronization (JOI13_synchronization) | C++17 | 290 ms | 35712 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 vll = vector <ll>;
using ii = pair <ll, ll>;
using vii = vector <ii>;
const ll MAXN = 1E5+16, LOG = 17;
ll anc[MAXN][LOG];
vii adj[MAXN];
bool isOn[MAXN];
ii edg[MAXN];
ll ans[MAXN];
ll last[MAXN];
ll tin[MAXN], tout[MAXN], timer = 0;
struct Fenwick {
vll tree;
ll n;
Fenwick (ll n): tree(n), n(n) {}
void update (ll ql, ll qr, ll val) { update(ql, val); update(qr+1, -val); }
void update (ll id, ll val) {
for (; id < n; id |= id+1) tree[id] += val;
}
ll query (ll id) {
ll ans = 0;
for (; id >= 0; id &= id+1, id--) ans += tree[id];
# | 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... |