Editorial for SAC '22 Code Challenge 2 P3 - Rating Choices


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Author: maxcruickshanks

Run a traditional graph searching algorithm (e.g., BFS or DFS) while maintaining your current rating.

Once you reach a leaf of this tree (i.e., there are no outgoing edges from this node), store the maximum rating in a global variable.

Time Complexity: \mathcal{O}(2^{N + 1})


Comments

There are no comments at the moment.