Acorn Duel (acorn)

23 teams scored 2240 points on this task, for a maximum score of 100, an average score of 97 and a median score of 100.

Highlights

  1. Galilei, Verona is the institute with the most points (100).
  2. Lombardia is the region with the most points (400).

Statement

This is an interactive problem. Your program must communicate with the evaluator: it should alternately write messages via standard output and read inputs from standard input. Chippy and Nutmeg, two rival squirrels, are racing to claim acorns scattered across trees numbered 0, 1, 2, … in a magical forest. They begin by placing two tokens on distinct trees X and Y (X ≠ Y). The squirrels take turns moving one of the two tokens to a strictly smaller-numbered tree, ensuring that both tokens never occupy the same tree. Chippy always moves first, and they continue alternating turns. The first squirrel unable to make a valid move loses the duel—along with their acorns! Determine the winner assuming both play optimally, and help them make the best moves each turn.