#P9278. [AGM 2023 资格赛] 另一个游戏
[AGM 2023 资格赛] 另一个游戏
Problem Description
Charlie and Dan are playing a game on piles of stones numbered from to from left to right. Each pile contains a positive number of stones.
They take turns making moves, and Charlie moves first.
On each turn, a player takes a positive number of stones from the leftmost non-empty pile and moves them to the adjacent pile on the right. If, on a player's turn, the only non-empty pile is pile , then that player loses the game.
If both players play optimally, who will win the game?
Input Format
The first line of input contains an integer , the number of piles.
The next line contains integers , representing the number of stones in each pile.
Output Format
Output the name of the player who wins.
3
2 2 2
Charlie
Hint
Translated by ChatGPT 5