結果

問題 No.582 キャンディー・ボックス3
ユーザー maimai
提出日時 2017-04-21 07:06:43
言語 Ruby
(3.2.2)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 302 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 11,584 KB
実行使用メモリ 15,332 KB
最終ジャッジ日時 2023-08-14 13:14:19
合計ジャッジ時間 2,827 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,224 KB
testcase_01 AC 79 ms
15,308 KB
testcase_02 AC 79 ms
15,260 KB
testcase_03 AC 79 ms
15,224 KB
testcase_04 AC 81 ms
15,132 KB
testcase_05 AC 78 ms
15,324 KB
testcase_06 AC 79 ms
15,108 KB
testcase_07 AC 79 ms
15,308 KB
testcase_08 AC 79 ms
15,316 KB
testcase_09 AC 80 ms
15,096 KB
testcase_10 AC 79 ms
15,256 KB
testcase_11 AC 79 ms
15,148 KB
testcase_12 AC 80 ms
15,308 KB
testcase_13 AC 78 ms
15,064 KB
testcase_14 AC 78 ms
15,136 KB
testcase_15 AC 79 ms
15,060 KB
testcase_16 AC 78 ms
15,252 KB
testcase_17 AC 78 ms
15,060 KB
testcase_18 AC 80 ms
15,332 KB
testcase_19 AC 80 ms
15,104 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp!.to_i
abort unless 1 <=n && n<=150

cstr = gets.chomp!
abort unless cstr =~ /^\d+(?: \d+)*$/
abort unless !gets


c = cstr.split.map(&:to_i)

count = Array.new(4,0)

c.each{|e| count[ [3,e].min ] += 1 }


if count[1].odd? && count[2]<=1 && count[3]==0
    puts 'A'
else
    puts 'B'
end
0