Skip to content

fallingapart

bradendubois edited this page Jun 9, 2021 · 6 revisions

Falling Apart

ID: fallingapart

Difficulty: 1.6

CPU Time: 1 second

Memory: 1024 MB

Solution

Since each person will (in alternating turns) take the biggest piece available, sort all the numbers given, and then alternate through the sorted list (largest to smallest) and add the respective number to either Alice or Bob's running totals. Afterwards, output Alice's, then Bob's.

Clone this wiki locally