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 1238. Folding

WA #25 - Can somebody help me?
Posted by Prime 19 Aug 2013 11:13
Code link: REMOVED after ac

I can't provide a test though but the bug that was causing WA was simple.

My DP recurrence was simple, dp[s][e] contains the shortest folding for the segment a[s]a[s+1]...a[e], where 'a' is the main string. Now, then I was calculating dp[s][e] I made an error and dp[s][e] was in some rare cases containing solutions of dp[s][e+1]dp[s][e+2]... ans the resulting sequence was containing lower length then actually possible.

Edited by author 19.08.2013 11:15

Edited by author 19.08.2013 15:43
Re: WA #25 - Can somebody help me?
Posted by QProgS 10 Apr 2014 16:09
aaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaab
aaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaab
aaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaab
aaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaab
aaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaab
aaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaab
aaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaabaaaaaaaaab