Dynamic Programming Solutions for Three Algorithmic Problems

Ehab and the Expected GCD Problem The key insight is that the first element should have the maximum number of prime factors, and subsequent elements should remove at most one prime factor per step for optimality. The smallest prime factors are 2 and 3, and using 3 more than once is suboptimal (e.g., 5 can be replaced by 2² for better results). ...

Posted on Fri, 17 Jul 2026 17:02:09 +0000 by RossC0

Advanced Dynamic Programming: Interval, Tree, and Bitmask Strategies

Maximizing Collected Value from Falling Objects Given n falling objects on a 2D plane, each with a falling speed and initial height, starting from position (x0, 0). When directly aligned with an object, it can be collected instantly, yielding a value equal to its current height divided by 1000. The objective is to maximize the total collected v ...

Posted on Tue, 09 Jun 2026 16:25:06 +0000 by KEFE