Need help on a difficult problem

Revision en1, by RayPatterson, 2018-08-16 14:45:20

Hi! I encountered this problem recently: https://szkopul.edu.pl/problemset/problem/QT9Um-jnm6-sf8Gerxu1EbkL/site/?key=statement.

I have given it 2 days of thought and still haven't managed to come up with an idea to solve it. I thought to represent the items as a tree, with the dependent of item i being its father. Then we will perform dynamic programming on it. However, I am unable to figure out what to save in the states, and boolean arrays are simply too large to pass.

Tags trees, dp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English RayPatterson 2018-08-16 14:45:20 512 Initial revision (published)