CF282D.Yet Another Number Game
提高+/省选-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Since most contestants do not read this part, I have to repeat that Bitlandians are quite weird. They have their own jobs, their own working method, their own lives, their own sausages and their own games!
Since you are so curious about Bitland, I'll give you the chance of peeking at one of these games.
BitLGM and BitAryo are playing yet another of their crazy-looking genius-needed Bitlandish games. They've got a sequence of n non-negative integers _a_1, _a_2, ..., a__n. The players make moves in turns. BitLGM moves first. Each player can and must do one of the two following actions in his turn:
- Take one of the integers (we'll denote it as a__i). Choose integer x (1 ≤ x ≤ a__i). And then decrease a__i by x, that is, apply assignment: a__i = a__i - x.
- Choose integer x
. And then decrease all a__i by x, that is, apply assignment: a__i = a__i - x, for all i.
The player who cannot make a move loses.
You're given the initial sequence _a_1, _a_2, ..., a__n. Determine who wins, if both players plays optimally well and if BitLGM and BitAryo start playing the described game in this sequence.
由于大多数参赛者并不阅读本部分,我不得不重申:比特兰人非常古怪。他们拥有自己的职业、自己的工作方式、自己的生活、自己的香肠,以及自己的游戏!
既然你对比特兰如此好奇,我将给你一个窥探他们其中一款游戏的机会。
比特利格姆(BitLGM)和比特阿里奥(BitAryo)正在玩另一款看似疯狂、实则需要天才智慧的比特兰式游戏。他们拥有一串长度为 n 的非负整数序列 a1,a2,...,an。双方轮流进行操作,比特利格姆先手。每位玩家在自己的回合中必须且只能执行以下两种操作之一:
- 选取其中一个整数(记为 ai),再选择一个整数 x(满足 1 ≤ x ≤ ai),然后将 ai 减去 x,即执行赋值操作:ai = ai − x。
- 选择一个整数 x
,然后将所有 ai 同时减去 x,即对所有 i 执行赋值操作:ai = ai − x。
无法进行任何操作的玩家判负。
现给出初始序列 a1,a2,...,an。假设双方均以最优策略进行游戏,请判断在该初始序列下,比特利格姆与比特阿里奥谁将获胜。
输入格式
The first line contains an integer n (1 ≤ n ≤ 3).
The next line contains n integers _a_1, _a_2, ..., a__n (0 ≤ a__i < 300).
第一行包含一个整数 n(1≤n≤3)。
接下来的一行包含 n 个整数 a1, a2, …, an(0≤ai<300)。
输出格式
Write the name of the winner (provided that both players play optimally well). Either "BitLGM" or "BitAryo" (without the quotes).
写出获胜者的名字(假设双方都以最优策略进行游戏)。只能是 “BitLGM” 或 “BitAryo”(不带引号)。
输入输出样例
输入#1
2 1 1
输出#1
BitLGM
输入#2
2 1 2
输出#2
BitAryo
输入#3
3 1 2 1
输出#3
BitLGM
输入解题思路,AI测评打分。不知道怎么写?