結果

問題 No.582 キャンディー・ボックス3
ユーザー KoshStorm
提出日時 2017-10-27 22:57:03
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-22 10:53:15
合計ジャッジ時間 1,634 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#B:キャンディーボックス3
N = int(input())
C = list(map(int,input().split(" ")))

C.reverse()

count2 = 0
count1 = 0
for i in C:
	if i >= 3:
		print("B")
		exit(0)
	elif i == 2:
		count2 += 1
		if count2 == 2:
			print("B")
			exit(0)
	elif i == 1:
		count1 += 1

if (count1 + 2)%2 == 1:
	print("A")
else:
	print("B")
0