APIO 2014 - Beads and Wires
Author: Andi Qu
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;45int n, a, b;6ll w, pw[200001], dp[200001][2][2];7vector<pair<int, ll>> graph[200001];89void 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!