Problem 2247 · Hard

Maximum Cost of Trip With K Highways

Bitmask DP over visited city sets: extend trips one highway at a time and keep the best trip with k + 1 cities.

Open the interactive visualisation