# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
827556 | Hanksburger | Two Currencies (JOI23_currencies) | C++17 | 592 ms | 54968 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;
long long par[100005][20], edge[100005], depth[100005], in[100005], out[100005], l1[100005], r1[100005], l2[100005], r2[100005], x[100005], y[100005], ans[100005], bit[200005], bit2[200005], n, m, q, sz;
vector<pair<long long, long long> > adj[100005], upd;
void dfs(long long u, long long p)
{
par[u][0]=p;
for (long long i=1; i<20; i++)
par[u][i]=par[par[u][i-1]][i-1];
for (long long i=0; i<adj[u].size(); i++)
{
long long v=adj[u][i].first, w=adj[u][i].second;
if (v==p)
continue;
depth[v]=depth[u]+1;
edge[v]=w;
in[w]=(++sz);
dfs(v, u);
out[w]=(++sz);
}
}
void update(long long s, long long t)
{
for (long long i=s; i<=sz; i+=i&(-i))
{
bit[i]+=t;
if (t>0)
bit2[i]++;
else
bit2[i]--;
Compilation message (stderr)
# | 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... |