# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
745135 | b00norp | Duathlon (APIO18_duathlon) | C++14 | 282 ms | 36004 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;
#define int long long
mt19937_64 RNG(chrono::steady_clock::now().time_since_epoch().count());
/*
- Make a bridge tree of the graph
- Store all the sizes of the nodes in bridge tree
- Case 1:
All 3 nodes in the same node (all s, c, f)
(siz) * (siz - 1) * (siz - 2)
- Case 2: 2 nodes in the same node. 1 node away (s, c) or (c, f)
s / f cannot be the node that joins the bridge node and the away node
=> -1 candidate for f, same candidates for c
=> [[(component_siz - siz) * (siz - 1) * (siz - 1)]] * 2 (for the 2 options)
- Case 3: 1 node here, 2 nodes in different subtrees (c)
=> if bridge is from same node, only that node can be c
=> else, siz options
*/
const int INF = 1e18;
const int N = 1e5 + 5;
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... |
# | 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... |