Editorial for WC '17 Contest 1 J3 - Stanley


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.

Let G_a be the number of games won by Team A, and G_b be the number of games won by Team B. We can initialize both of these values to 0 and then process the games in the series one by one. For each game i, we can input its A_i and B_i values, and then either increment G_a if A_i > B_i, or increment G_b otherwise (if B_i > A_i). Once either G_a = 4 or G_b = 4, we should stop processing games and output the current values of G_a and G_b.


Comments

There are no comments at the moment.