# Algorithms Explained

## USACO 2013 Open P1: Photo

USACO 2013 US Open, Gold Problem 1. Photo

## Dynamic Range Minimum Queries

CSES 1649: Dynamic Range Minimum Queries

Sum of digits

## Japan 2005 Domestic: Traveling by Stagecoach

Japan 2005 Domestic: Traveling by Stagecoach

## Central Europe 2003: Minimizing maximizer

Central Europe 2003: Minimizing maximizer

## Japan 2005 Domestic: Traveling by Stagecoach

Japan 2005 Domestic: Traveling by Stagecoach

Course Selection

## A Party Without a Boss

A Party Without a Boss

KK’s Chemicals

## USACO 2007 March Gold P3: Face The Right Way

USACO 2007 March Gold P3: Face The Right Way

## USACO 2005 December Gold P3: Layout

USACO 2005 December Gold P3: Layout

## Slicing Window Query: Min and Max of the Window

Slicing Window Query: Min and Max of the Window

## KMP Algorithm Explained

KMP Algorithm Explained

## Coordinate Compression: Range Sum

Coordinate Compression: Range Sum

## Interval DP: Scored Binary Tree

Interval DP: Bonus Binary Tree

## Interval DP Illustrated: Stone Merger

What is DP on Interval?

## DP Multiple Knapsack

DP Multiple Knapsack

## DP Mixed Knapsack

DP Mixed Knapsack Problem

## DP Finite Automata with Compression: Treasure Hunt

DP Finite Automata with Compression: Treasure Hunt

## DP Finite Automata with Compression: Password Counting

DP Finite Automata with Compression: Password Counting

## DP Finite Automata with Compression: DNA Repairing

DP Finite Automata with Compression: DNA Repairing

## DP Finite Automata with Compression: Little King

DP Finite Automata with Compression: Little King

## DP Finite Automata with Compression: Corn Yard

DP Finite Automata with Compression: Corn Yard

## DP Finite Automata with Compression: Artillery Position

DP Finite Automata with Compression: Artillery Position

## Group Knapsack Problem

Group Knapsack Problem

## Dynamic Programming: Number Combination

Dynamic Programming: Number Combination

## Dynamic Programming: Knapsack with Multiple Contstraits

Dynamic Programming: Knapsack with Multiple Contstraits

## Dynamic Programming: Currency System

Dynamic Programming: Currency System

## 0/1 Knapsack and UnBounded Knapsack Problem

0/1 Knapsack Problem

## Missile Defense System

Missile Defense System

## Dynamic Programming: Sister Cities

Dynamic Programming: Sister Cities

## Dynamic Programming: Chrous

Dynamic Programming: Chrous

## Dynmamic Programming: Passing Notes

Dynmamic Programming: Passing Notes (Chinese NOIP2008 Intermediate Q3)

## Dynamic Programming: Longest Increasing Subsequence O(NlogN) Algorithm

Longest Increasing Subsequence O(NlogN) Algorithm

## Dynamic Programming: Longest Increasing Subsequence

Longest Increasing Subsequence

## Dynamic Programming: Longest Common Subsequence

Longest Common Subsequence

## Dynmamic Programming: LCIS (Longest Common Increasing Sequence)

Dynmamic Programming: LCIS (Longest Common Increasing Sequence)

## USACO 2015 Feb Bronze

USACO 2015 Feb Bronze

## USACO 2016 Dec Bronze

USACO 2016 Dec Bronze

## USACO 2014 Jan Silver

USACO 2014 Jan Silver

## USACO 2014 Feb Silver

USACO 2014 Feb Silver

## USACO 2013 Open Silver

USACO 2013 Open Silver

## USACO 2013 Nov Silver

USACO 2013 Nov Silver

## USACO 2013 Nov Bronze

USACO 2013 Nov Bronze

## USACO 2013 Mar Silver

USACO 2013 Mar Silver

## USACO 2013 Feb Silver

USACO 2013 Feb Silver

## USACO 2012 Nov Silver

USACO 2012 Nov Silver

## USACO 2012 Dec Silver

USACO 2012 Dec Silver

## USACO 2011 Nov Silver

USACO 2011 Nov Silver

## USACO 2017 Open Bronze

USACO 2017 Open Bronze

## USACO 2017 Feb Bronze

USACO 2017 Feb Bronze

## Floodfill

Floodfill (Recursive)

## Sorting and Custom Comparators

Sorting with C++ Struct

## USACO 2017 Dec Bronze

USACO 2017 Dec Bronze

## USACO 2016 Jan Silver

USACO 2019 Jan Silver

## USACO 2017 Jan Bronze

USACO 2017 Jan Bronze

## USACO 2019 Jan Silver

USACO 2019 Jan Silver

## USACO 2018 Dec Silver

USACO 2018 Dec Silver

## USACO 2017 Jan Bronze

USACO 2017 Jan Bronze

## USACO 2015 Feb Bronze

USACO 2015 Feb Bronze

## USACO 2018 Feb Silver

USACO 2018 Feb Silver

## USACO 2018 Open Silver

USACO 2018 Open Silver

## USACO 2018 Open Bronze

USACO 2018 Open Bronze

## USACO 2020 Feb Bronze

USACO 2020 Feb Bronze

## USACO 2017 Open Silver

USACO 2017 Open Silver

## USACO 2017 Dec Silver

USACO 2017 Dec Silver

## USACO 2020 Jan Silver

USACO 2020 Jan Silver

## USACO 2019 Open Silver

USACO 2019 Open Silver

Tree Algorithms

## USACO 2016 Dec Gold

USACO 2016 Dec Gold

## USACO 2017 Feb Silver

USACO 2017 Feb Silver

## USACO 2016 Feb Silver

USACO 2016 Feb Silver

Binary Search

## USACO 2019 Feb Silver

USACO 2019 Feb Silver

## USACO 2019 Jan Silver

USACO 2019 Jan Silver

## USACO 2020 Open Silver

USACO 2020 Open Silver

## USACO 2017 Jan Silver

USACO 2017 Jan Silver

## USACO 2018 Jan Silver

USACO 2018 Jan Silver

## Bitwise Operations and Subset Algorithms

Bitwise Operations and Subset Algorithms

Graph Algorithms

## USACO 2020 Jan Bronze

USACO 2020 Jan Bronze

## USACO 2020 Feb Silver

USACO 2020 Feb Silver

## USACO 2019 Dec Silver

USACO 2019 Dec Silver

## USACO 2016 Jan Silver

USACO 2016 Jan Silver

## USACO 2016 Dec Silver

USACO 2016 Dec Silver

Grid Paths

## An Impassioned Circulation of Affection

C. An Impassed Circulation of Affection

## Binary Search Examples

Binary Search Examples

## USACO 2016 Open Silver

USACO 2016 Open Silver

## Maximum Subarray Sum

Maximum Subarray Sum

## USACO 2019 Jan Bronze

USACO 2019 Jan Bronze

## USACO 2019 Dec Bronze

USACO 2019 Dec Bronze

## USACO 2018 Dec Bronze

USACO 2018 Dec Bronze

## USACO 2017 Jan Silver

USACO 2017 Jan Silver

## USACO 2015 Dec Silver

USACO 2015 Dec Silver

Prefix Sum

Monotonous Stack

## USACO 2014 Dec Silver

USACO 2014 December Silver

## USACO 2014 Dec Gold

USACO 2014 December Gold

Subsets

Permutations

## Palindrome Partitioning

Palindrome Partitioning

Combination Sum

Unique Paths II

## Longest Increasing Subsequence

Longest Increasing Subsequence

House Robber

Climbing Stairs

## Best Time to Buy and Sell Stock

Best Time to Buy and Sell Stock

BFS Distance

## Greedy: Boyer-Moore’s Majority Vote

Boyer-Moore’s Majority Vote Algorithm

## Tree Traversal

Tree Traversal Algorithm

## Greedy: Dijkstra’s Shortest Path

Dijkstra’s Shortest Path

## Backtracking: Knights Tour Algorithm

Knights Tour Algorithm

## Backtracking: Hamiltonean Cycles Algorithm

Hamiltonean Cycles

## Recursion vs. Dynamic Programming Using a Question from AMC8

Recursion vs. Dynamic Programming Using a Question from AMC8

Flood Fill

## Basic Math in Programming

Basic Math in Programming

## Function Argument Passing in Python

Function Argument Passing in Python

Merge Sort

## Prime Numbers with Sieve of Eratosthenes

Generating Prime Numbers using Sieve of Eratosthenes algorithm

Selection Sort