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++

Table of Contents

Edit on Github

IOI 2005 - Rivers

Author: Benjamin Qi

Table of Contents


Edit on Github
1#include <bits/stdc++.h>
2using namespace std;
3
4using ll = long long;
5using ld = long double;
6using db = double;
7using str = string; // yay python!
8
9using pi = pair<int,int>;
10using pl = pair<ll,ll>;

Give Us Feedback on IOI 2005 - Rivers!

Join the Discussion!

Feel free to voice your thoughts in the comments section.

Need help? Join the USACO Forum!