Relative Content

Tag Archive for algorithmdynamic-programming

Rod cutting problem: alternate recurrence in interview

The rod cutting problem is described in section 15.1 of the book “Introduction to algorithms” by Carmen et.al. We are given an array, p where p[j] represents the money we’ll get for a rod of length j. Given a rod of length n, what is the most money that can be made by cutting it optimally and selling the pieces?

Codeforces: D2. Counting Is Fun (Hard Version)

Problem An array ???? of ???? non-negative integers is said to be good if all the elements of ???? can be made equal to 0 using the following operation some (possibly, zero) times: Select two distinct indices ???? and ???? (1≤????<????≤????) and subtract 1 from all ???????? such that ????≤????≤???? . You are given two […]