結果

問題 No.582 キャンディー・ボックス3
コンテスト
ユーザー brthyyjp
提出日時 2021-10-18 10:59:19
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 32 ms / 2,000 ms
+ 543µs
コード長 380 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 82 ms
コンパイル使用メモリ 65,088 KB
実行使用メモリ 53,760 KB
最終ジャッジ日時 2026-10-20 02:32:55
合計ジャッジ時間 2,549 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
C = list(map(int, input().split()))
c1 = 0
c2 = 0
total = 0
for c in C:
    if c == 1:
        c1 += 1
    if c == 2:
        c2 += 1
    if c > 0:
        total += 1
if c2 == 0:
    if c1 == total and c1%2 == 1:
        print('A')
    else:
        print('B')
else:
    if c2 == 1 and c1 == total-1 and c1%2 == 1:
        print('A')
    else:
        print('B')
0