Editorial for COCI '19 Contest 6 #5 Trener
Submitting an official solution before solving the problem yourself is a bannable offence.
For the first subtask, you could have checked each possibility. The complexity is
For the next two subtasks, it was necessary to build a directed acyclic graph (DAG) and count the number of paths from nodes on the first level to the nodes on the last level. This can be done using dynamic programming and we leave it as an exercise to the reader. Let's describe what kind of DAG will be built.
On each of the
Comments