|
|
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)) Is there any mathematical algorithm or i need to check every way mages can go problem description said dragon will not use breath two times, but test 21 there is at least three breath in the input file... hope admin can fix it.. oops I misunderstood "in a row" is "in a row" means cosecutive?? I think we must use O(2^20*10) dynamic programming ,because there maybe two breath in a row brute_force will definitely got TLE Oh, there are no such cases. There is at least one healer and one attacker. Fixed in statement now. tl;dr And only one guy could solve this :D Each sentence in problem statement makes sense, it can't be reduced. There are three author solutions, but two other guys didn't submit them. BTW, I don't think that this problem so difficult, try to solve it. P.S. "Условие задачи" = "Problem statement", "condition" - условие, которое может быть истинным или ложным Edited by author 14.12.2013 18:41 |
|
|