Data Structures
Max Suffix Query with Insertions OnlyWavelet TreeCounting Minimums with Segment TreeSegment Tree BeatsPersistent Data StructuresTreaps
Convexity
LineContainerLagrangian RelaxationSlope Trick
Graphs
Shortest Paths with Negative Edge WeightsEulerian ToursBCCs and 2CCsStrongly Connected ComponentsOffline DeletionEuler's FormulaCriticalLink Cut Tree
Dynamic Programming
DP on Trees - Combining SubtreesAdditional DP Optimizations and TechniquesSum over Subsets DP
Flows
Maximum FlowMinimum CutFlow with Lower BoundsMinimum Cost Flow
Polynomials
Introduction to Fast Fourier TransformMore Complex Operations Using FFT
Strings
String SearchingSuffix ArrayString Suffix Structures
Misc. Topics
Extended Euclidean AlgorithmXOR BasisFracturing SearchGame TheoryPrefix Sums of Multiplicative FunctionsMatroid IntersectionInteractive and Communication ProblemsVectorization in C++

COCI 2019 - Dzumbus

Author: Benjamin Qi

Appears In

  • Advanced - DP on Trees - Combining Subtrees

Edit with LiveUpdate
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using db = double;
using str = string; // yay python!
using pi = pair<int,int>;
using pl = pair<ll,ll>;

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!

Join Forum