結果

問題 No.582 キャンディー・ボックス3
ユーザー syunsukesyunsuke
提出日時 2018-07-07 15:41:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 7,940 KB
最終ジャッジ日時 2023-09-17 21:09:46
合計ジャッジ時間 1,280 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,916 KB
testcase_01 AC 16 ms
7,784 KB
testcase_02 AC 16 ms
7,912 KB
testcase_03 AC 16 ms
7,828 KB
testcase_04 AC 16 ms
7,800 KB
testcase_05 AC 16 ms
7,940 KB
testcase_06 AC 16 ms
7,904 KB
testcase_07 AC 16 ms
7,804 KB
testcase_08 AC 16 ms
7,812 KB
testcase_09 AC 16 ms
7,840 KB
testcase_10 AC 16 ms
7,860 KB
testcase_11 AC 15 ms
7,852 KB
testcase_12 AC 16 ms
7,848 KB
testcase_13 AC 16 ms
7,848 KB
testcase_14 AC 15 ms
7,804 KB
testcase_15 AC 15 ms
7,788 KB
testcase_16 AC 15 ms
7,796 KB
testcase_17 AC 16 ms
7,772 KB
testcase_18 AC 15 ms
7,920 KB
testcase_19 AC 15 ms
7,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

box=int(input())
list1=[]
line=input()
line=line.rstrip().split(" ")
win=0
for i in range(len(line)):
    if int(line[i])>=3:
        win=1
        break
    elif int(line[i])==0:
        pass
    elif int(line[i])==1 or int(line[i])==2:
        list1.append(int(line[i]))

c1=list1.count(1)
c2=list1.count(2)
if win==1:
    print("B")
elif c2>=2:
    print("B")
elif c2==1:
    if c1%2==1:
        print("A")
    else:
        print("B")
elif c1%2==0:
    print("B")
else:
    print("A")
    
0