結果

問題 No.582 キャンディー・ボックス3
ユーザー yoza
提出日時 2017-10-27 22:46:40
言語 Ruby
(3.4.1)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 217 bytes
コンパイル時間 43 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-11-22 10:52:37
合計ジャッジ時間 2,578 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n = gets.to_i
c_list = gets.split.map(&:to_i)

gt2 = c_list.count {|c| c > 2}
two = c_list.count(2)
one = c_list.count(1)

if gt2 > 0 or two > 1
  puts 'B'
elsif (one + two * 2) % 2 == 0
  puts 'B'
else
  puts 'A'
end
0