Editorial for COCI '06 Contest 3 #1 Patuljci
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.
Instead of writing seven nested for-loops to choose the seven candidate dwarves and check, we can choose two dwarves considered not in the group and check if the proposition is valid.
We add up the nine numbers and find two numbers that we need to subtract to get 100, using two nested for-loops. We then output the other seven numbers.
Comments