-
Notifications
You must be signed in to change notification settings - Fork 2
brokenswords
bradendubois edited this page Oct 7, 2021
·
7 revisions
ID: brokenswords
Difficulty: 1.8
CPU Time: 1 second
Memory: 1024 MB
For this, keep a tally of TB (we can combine them) and LR slats, both initialized to 0. For each line, increment TB for each of the first/second values that are 0, and LR for each of the third/fourth that are 0. Then, since T and B, and L and R are interchangeable, the number of swords we can make is min(TB, LR) / 2. So, output this many swords, TB - swords * 2, LR - swords * 2.