APIO 2014 - Beads and Wires

Author: Andi Qu

Table of Contents

Code
Edit on Github

This section is not complete.

Feel free to file a request to complete this using the "Contact Us" button.

Code

1#include <bits/stdc++.h>
2typedef long long ll;
3using namespace std;
4
5int n, a, b;
6ll w, pw[200001], dp[200001][2][2];
7vector<pair<int, ll>> graph[200001];
8
9void dfs(int node, int par) {
10 if (graph[node].size() == 1 && par != -1) return;

Join the USACO Forum!

Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!

Give Us Feedback on APIO 2014 - Beads and Wires!