ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1952. To Kill the Dragon

a little hint
Posted by LeTim 14 Oct 2024 19:48
use dynamic programming by subsets, one mask in DP state for one breath in a row and two masks in DP state for two breaths in a row, time complexity ~O(k * (n+m)^2 * 4^(n+m))