結果
問題 |
No.582 キャンディー・ボックス3
|
ユーザー |
|
提出日時 | 2017-04-14 02:02:21 |
言語 | Ruby (3.4.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 301 bytes |
コンパイル時間 | 330 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-07-19 21:32:28 |
合計ジャッジ時間 | 3,521 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 RE * 7 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.chomp!.to_i abort unless 1 <=n && n<=10 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