結果
問題 |
No.349 干支の置き物
|
ユーザー |
![]() |
提出日時 | 2016-03-19 20:22:27 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 96 ms / 2,000 ms |
コード長 | 300 bytes |
コンパイル時間 | 259 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-11-17 07:28:17 |
合計ジャッジ時間 | 4,380 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
コンパイルメッセージ
Syntax OK
ソースコード
class Yukicoder def initialize n = gets.chomp.to_i hash = Hash.new(0) n.times do eto = gets.chomp hash[eto] += 1 end hash = hash.sort_by{|k,v| -v}.to_h.values if hash[0] > (n/2.0).ceil puts "NO" else puts "YES" end end end Yukicoder.new