Problem 2827 · Hard

Number of Beautiful Integers in the Range

Count beautiful integers up to each bound with a digit DP over the even-minus-odd digit difference and the remainder mod k, then subtract.

Open the interactive visualisation