Similar codes but one gettting AC and other RE — Problem 570E — Pig and Palindromes

Revision en1, by shubhamphpefy, 2024-09-02 13:17:16

I was solving this problem and submitted first and second. But It seems that the first code is getting RE on tc14 and the second one is getting accepted.

I am not sure why is this happening. The only difference in the two codes is first one has dp[maxn/2][maxn][maxm] and second have dp[maxn][maxn/2][maxm] .

Please help. Thanks.

Tags dynamic programming, dp, codeforces, cf

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English shubhamphpefy 2024-09-02 13:17:16 588 Initial revision (published)