Dynamic Programming Problem Collection and Solutions

Problem List [AGC034E] Complete Compress New Year and Original Order [AGC024F] Simple Subsequence Problem The Story of a Certain Songstress [POI2015] MYJ Periodni [AGC026D] Histogram Coloring [JOI Open 2016] Skyscraper [USACO19DEC] Tree Depth P [BZOJ3864] Hero Meet Devil LOJ 6274 - Numbers Yet Another Minimization Problem [USACO19FEB] Mowing M ...

Posted on Tue, 04 Aug 2026 16:36:39 +0000 by zalath

Solution: COCI 2015-2016 #6 Problem SAN

Problem Analysis: Digit DP Before explaining the correct solution, let's first discuss the partial score approach. For 50% of the data, where (1 \le L, R \le 10^6), a brute force simulation might be feasible. However, since we don't know the exact positions where each number appears, directly simulating with a 2D array is likely to cause memory ...

Posted on Thu, 28 May 2026 19:36:55 +0000 by Fawkman

Introduction to Digit Dynamic Programming

When solving counting problems over large numerical ranges, traditional anumeration becomes inefficient due to redundant computations. Consider counting processes from 7000 to 7999, 8000 to 8999, and 9000 to 9999. These intervals share a common pattern: the lower three digits cycle from 000 to 999, with only the thousand's digit varying. This o ...

Posted on Wed, 20 May 2026 18:55:12 +0000 by cbrooks