Editorial for CCC '24 J2 - Dusa And The Yobis
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.
This year, a twist was introduced at this early point of the contest. We are told Dusa's starting size and the size of the Yobis, but we are not told how many Yobis there are. This means that a while loop, or the equivalent, is needed instead of a for loop which might be more familiar. That is, we can continue reading input and adding the size of the current Yobi to the size of the Dusa while the size of the Dusa is less than the size of the current Yobi. Put another way, the loop continues until a Yobi is encountered that is the same size as the Dusa or larger.
Comments