結果

問題 No.582 キャンディー・ボックス3
ユーザー FromBooskaFromBooska
提出日時 2023-03-17 08:44:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 707 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 81,684 KB
実行使用メモリ 53,440 KB
最終ジャッジ日時 2023-10-18 13:30:45
合計ジャッジ時間 1,893 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,440 KB
testcase_01 AC 38 ms
53,440 KB
testcase_02 AC 43 ms
53,440 KB
testcase_03 AC 38 ms
53,440 KB
testcase_04 AC 39 ms
53,440 KB
testcase_05 AC 38 ms
53,440 KB
testcase_06 AC 38 ms
53,440 KB
testcase_07 AC 38 ms
53,440 KB
testcase_08 AC 39 ms
53,440 KB
testcase_09 AC 39 ms
53,440 KB
testcase_10 AC 39 ms
53,440 KB
testcase_11 AC 39 ms
53,440 KB
testcase_12 AC 39 ms
53,440 KB
testcase_13 AC 38 ms
53,440 KB
testcase_14 AC 39 ms
53,440 KB
testcase_15 AC 38 ms
53,440 KB
testcase_16 AC 39 ms
53,440 KB
testcase_17 AC 39 ms
53,440 KB
testcase_18 AC 39 ms
53,440 KB
testcase_19 AC 39 ms
53,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# Grundy数でダメだった、確かに[1, 3]はGrundy数だと勝てるはずだけど負ける
# 先攻が勝てるのは手番で[1]または手番が終わって[1, 1]
# そうなるのは1が奇数個だけ
# 1が奇数個と2が1個だけか
# 3以上が入ればダメ

N = int(input())
C = list(map(int, input().split()))
one_count = 0
two_count = 0
three_above = 0
for i in range(N):
    if C[i] == 1:
        one_count += 1
    elif C[i] == 2:
        two_count += 1
    elif C[i] >= 3:
        three_above += 1    
if one_count%2 == 1 and two_count == 0 and three_above == 0:
    print('A')
elif one_count%2 == 1 and two_count == 1 and three_above == 0:
    print('A')
else:
    print('B')
    
0