Editorial for DMOPC '15 Contest 3 P3 - Dimethylbenzene
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.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Knowledge required: DFS or for loops
This problem involves a graph of a molecule — however, this does not mean it requires any knowledge of graph theory to solve! Since the bounds are small (up to atoms and bonds), one does not have to implement a functional graph traversal: seven nested for loops work.
Remember that a bond between and implies a bond between and .
Time Complexity:
Comments
DOES TIME COMPLEXITY NOT EXIST IN THIS PROBLEM?!!!???!!!!!