USACO08MAR River Crossing S - Complete Knapsack and Interval DP Solutions
Problem Link
Luogu P2904 [USACO08MAR] River Crossing S
Approach 1: Copmlete Knapsack DP
First, observe the problem constraints. We need to transport all (n) cows across the river, minimizing the total time. Suppose we make (k) trips, and on the (i)-th trip we take (a_i) cows. Then (a_1 + a_2 + \dots + a_k = n). This can be viewed as having (n) ...
Posted on Thu, 30 Jul 2026 16:26:47 +0000 by nblackwood