# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
782304 | AmirElarbi | Two Currencies (JOI23_currencies) | C++14 | 270 ms | 32256 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<ext/pb_ds/assoc_container.hpp>
#define INF 1e9
#define ve vector
#define vi ve<int>
#define ii pair<int,int>
#define vii ve<ii>
#define pb push_back
#define fi first
#define se second
#define ll long long
using namespace __gnu_pbds;
using namespace std;
const int nax = 1e5+5;
const int kax = 25+5;
const int MOD = 1e9+7;
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
int cnt = 0, cur = 0, tin[nax], tout[nax], up[nax][kax];
vii adj[nax];
ll dep[nax], w[nax];
void dfs(int u, int p){
tin[u] = cur++;
up[u][0] = p;
for(int i = 1; i < kax; i++)
up[u][i] = up[up[u][i-1]][i-1];
for(auto x : adj[u]){
if(x.fi == p) continue;
dep[x.fi] = dep[u]+w[x.se];
dfs(x.fi,u);
}
# | 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... |