APIO 2014 - Beads and Wires

Author: Andi Qu


This section is not complete.

Any help would be appreciated! Just submit a Pull Request on Github.

Implementation

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int n, a, b;
ll w, pw[200001], dp[200001][2][2];
vector<pair<int, ll>> graph[200001];
void dfs(int node, int par) {
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!