結果
| 問題 | No.582 キャンディー・ボックス3 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-10-27 23:59:21 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 34 ms / 2,000 ms | 
| コード長 | 441 bytes | 
| コンパイル時間 | 195 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-11-22 10:56:03 | 
| 合計ジャッジ時間 | 1,822 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 17 | 
ソースコード
def main():
    N = int(input())
    C = tuple(map(int, input().split()))
    cnt = 0
    for i in C:
        if i >= 2:
            cnt += 1
    sumc = sum(C)
    maxc = max(C)
    if maxc == 1:
        if sumc % 2:
            ans = 'A'
        else:
            ans = 'B'
    elif maxc == 2:
        if cnt == 1 and sumc % 2:
            ans = 'A'
        else:
            ans = 'B'
    else:
        ans = 'B'
    print(ans)
main()
            
            
            
        