# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
156100 | EntityIT | 전압 (JOI14_voltage) | C++14 | 225 ms | 21240 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;
const int N = (int)1e5 + 5, M = N << 1, inf = (int)1e9 + 123;
int n, m, disc[N], low[N], curDisc, ans, nBadEdge, nBadEdgeTree[N];
bool parity[N], vis[N];
vector<int> gr[N], graph[N];
struct Edge {
int u, v;
bool used;
Edge(int _u = 0, int _v = 0, bool _used = 0) : u(_u), v(_v), used(_used) {}
int oth(int vertex) { return u ^ v ^ vertex; }
} edge[M];
void dfs(int u, int p) {
disc[u] = low[u] = ++curDisc;
parity[u] = parity[p] ^ 1;
for (int id : gr[u]) if (!edge[id].used) {
edge[id].used = 1;
int v = edge[id].oth(u);
if (!disc[v]) {
graph[u].emplace_back(v);
dfs(v, u);
nBadEdgeTree[u] += nBadEdgeTree[v];
low[u] = min(low[u], low[v]);
}
else {
if (parity[u] == parity[v]) {
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... |