Interesting DP problem from NOI PH 2018 Preselection

Revision en1, by sadbubbles, 2020-08-10 21:17:29

A few days ago I found a problem called Weird Keyboard in the Progvar problemsets under the category of DP classics with twists (Progvar is now down sadly, but the problem is still accessible).

I couldn't manage to solve it on my own, and I didn't find any solutions online either, but a friend of mine provided a solution using DP with Trie, which he got AC with. I cannot explain his solution too well, since I haven't learnt any string algorithms/structures yet, but in case anyone is interested, you can see his code here (excuse the long template).

Can anyone think of a solution to this problem that doesn't make use of any string algorithms/structures? Or any alternative solution at all?

Thanks!

Tags #dp, #strings

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English sadbubbles 2020-08-10 21:36:10 430 Tiny change: '_1| + ... |S_k| <= ' -> '_1| + ... + |S_k| <= '
en2 English sadbubbles 2020-08-10 21:18:03 0 (published)
en1 English sadbubbles 2020-08-10 21:17:29 944 Initial revision (saved to drafts)