結果

問題 No.582 キャンディー・ボックス3
ユーザー fiord
提出日時 2017-10-27 23:13:38
言語 Ruby
(3.4.1)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-11-22 10:54:13
合計ジャッジ時間 2,622 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
c=gets.split(" ").map(&:to_i)
n=c.length-c.count(0)
if c.max>2 then
    puts "B"
elsif c.count(2)>1 then
    puts "B"
elsif c.count(2)==1 then
    if n%2==0 then
        puts "A"
    else
        puts "B"
    end
else
    if n%2==0 then
        puts "B"
    else
        puts "A"
    end
end
0