# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
916114 | ThylOne | Two Currencies (JOI23_currencies) | C++14 | 1141 ms | 69036 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.
//####################
//TwoCurrencies
//####################
#include<bits/stdc++.h>
#include <functional>
using ll = long long;
using namespace std;
const int maxiN = 1000042;
const int LOG = 19;
int n, m, q;
vector < int > links[maxiN];
int depth[maxiN];
int up[maxiN][LOG];
void root(int node, int d = 0, int parent = -1) {
up[node][0] = parent;
depth[node] = d;
for (int v: links[node])
if (v != parent) {
root(v, d + 1, node);
}
}
int getK(int node, int K) {
for (int i = LOG - 1; i >= 0; i--) {
if ((K >> i) & 1) {
node = up[node][i];
}
}
return node;
# | 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... |