# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
401679 | hoaphat1 | Swapping Cities (APIO20_swap) | C++17 | 717 ms | 53124 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;
struct graph {
int n, nlog;
vector<vector<pair<int,int>>> g;
vector<vector<int>> pr;
vector<vector<int>> val;
vector<int> pos;
vector<int> end;
graph() {
}
void resize(int n) {
g.resize(n);
pos.resize(n);
end.resize(n);
nlog = 0;
while (1 << nlog <= n) nlog++;
pr.resize(n, vector<int> (nlog));
val.resize(n, vector<int> (nlog));
}
void add(int u, int v, int w) {
g[u].emplace_back(v, w);
g[v].emplace_back(u, w);
}
void dfs(int v, int p = 0) {
static int count = -1;
pos[v] = ++count;
# | 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... |