# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
47525 | aome | Special graph (IZhO13_specialg) | C++17 | 133 ms | 34904 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 Query {
int t, x, y;
Query (int t, int x, int y) : t(t), x(x), y(y) {}
};
const int N = 100005;
int n, m, cnt;
int h[N], p[20][N], nxt[N];
int par[N], deg[N], res[N];
int pos[N], cir[N], sz[N];
bool visit[N], iscir[N];
vector<int> G[N];
vector<Query> query;
void dfs(int u) {
for (auto v : G[u]) {
if (v == p[0][u]) continue;
h[v] = h[u] + 1, dfs(v);
}
}
void find_cir(int u) {
pos[u] = ++sz[cnt], cir[u] = cnt;
if (cir[nxt[u]]) return;
find_cir(nxt[u]);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |