結果
問題 | No.582 キャンディー・ボックス3 |
ユーザー |
|
提出日時 | 2017-04-21 07:06:43 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 96 ms / 2,000 ms |
コード長 | 302 bytes |
コンパイル時間 | 45 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-11-22 10:47:54 |
合計ジャッジ時間 | 2,664 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
コンパイルメッセージ
Syntax OK
ソースコード
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