Editorial for DMOPC '14 Exam Time P3 - Chemistry Homework

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.

By Eduard Ionescu

One solution is to use an Adjacency List to keep track of the edges (bonds) between the vertices (atoms). You can then determine whether each atom is a Carbon or Hydrogen based on the number of bonds and count their respective frequencies. Afterwards, for each atom, add the required bond energy to the total value and remember to take double-bonds into account.



There are no comments at the moment.