# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1115229 | Thunnus | Torrent (COI16_torrent) | C++17 | 536 ms | 41400 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;
using i64 = long long;
#define int i64
#define vi vector<int>
#define vvi vector<vi>
#define vb vector<bool>
#define pii pair<int, int>
#define fi first
#define se second
#define sz(x) (int)(x).size()
signed main(){
ios_base::sync_with_stdio(false); cin.tie(0);
int n, a, b, u, v;
cin >> n >> a >> b;
a--, b--;
vvi adj(n);
for(int i = 0; i < n - 1; i++){
cin >> u >> v;
adj[--u].emplace_back(--v);
adj[v].emplace_back(u);
}
vi dp(n), par(n), dep(n);
vector<pii> edges;
int chosen = -1;
auto chosen_edge = [&](int a, int b) -> bool {
if(chosen == -1) return false;
return ((a == edges[chosen].fi && b == edges[chosen].se) || (a == edges[chosen].se && b == edges[chosen].fi));
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |