Preview

The Hitchhikers Guide To the Programming Contests

Good Essays
Open Document
Open Document
22662 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
The Hitchhikers Guide To the Programming Contests
The Hitchhiker’s Guide to the Programming Contests

Do Panic

Nite Nimajneb

Contents
1 Dynamic Programming
1.1 Subset Sum . . . . . . . . . . . . . . . . . .
1.2 The Longest Increasing Subsequence . . . .
1.3 Longest Common Subsequence . . . . . . .
1.3.1 Reduce the Space to One Dimension
1.4 Max Sum on a Line . . . . . . . . . . . . .
1.5 The Best Triangulation . . . . . . . . . . .
1.6 Counting or Optimizing Good Paths . . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

1
1
1
2
3
3
3
4

2 Graphs
2.1 Breadth First Search . . . . . . . . . . . . . . .
2.2 Depth First Search . . . . . . . . . . . . . . . .
2.2.1 Topological Sorting . . . . . . . . . . . .
2.2.2 Strongly Connected Components . . . .
2.2.3 Cut Point . . . . . . . . . . . . . . . . .
2.3 Shortest Paths . . . . . . . . . . . . . . . . . .
2.3.1 Bellman-Ford . . . . . . . . . . . . . . .
2.3.2 Floyd-Warshall . . . . . . . . . . . . . .
2.3.3 Dijkstra . . . . . . . . . . . . . . . . . .
2.3.4 The Shortest Path DAG . . . . . . . . .
2.4 Counting the Paths . . . . . . . . . . . . . . . .
2.5 The Minimum Average Cycle . . . . . . . . . .
2.6 The Minimum Spanning Tree . . . . . . . . . .
2.7 Bipartite Matching . . . . . . . . . . . . . . . .
2.8 Maximum Flows . . . . . . . . . . . . . . . . .
2.9 Minimum (Maximum) Cost Bipartite Matching
2.10 Minimum Cost (Maximum Profit) Flow . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

You May Also Find These Documents Helpful

Related Topics