Programmers and Stones
시간 제한2초메모리 제한2048 MB
n개의 돌무더기가 주어지고, 매 턴 비어 있지 않은 무더기 중 임의의 부분집합에서 돌을 하나씩 제거하며, 최적으로 둘 때 승자를 판정한다.
문제
Programmers Alice and Dmitry invented a new game. In this game, there are piles of stones on the table. The players take turns starting from Alice. On their turn, a player picks an arbitrary non-empty set of non-empty piles, and then remove one stone from each of them. The player who can't make a move loses. Who will win the game if both play optimally?
입력
The first line contains an integer ().
The second line contains numbers : the initial sizes of the piles of stones ().
출력
Print "Alice" or "Dmitry", depending on who wins the game. In the names, letter case does matter.