結果

問題 No.349 干支の置き物
ユーザー zazaboonzazaboon
提出日時 2016-05-26 02:13:25
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 184 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-04-16 16:49:05
合計ジャッジ時間 3,881 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
12,288 KB
testcase_01 AC 88 ms
12,160 KB
testcase_02 AC 86 ms
12,160 KB
testcase_03 AC 86 ms
12,160 KB
testcase_04 AC 89 ms
12,160 KB
testcase_05 AC 88 ms
12,032 KB
testcase_06 AC 85 ms
12,288 KB
testcase_07 AC 88 ms
12,288 KB
testcase_08 AC 87 ms
12,288 KB
testcase_09 AC 88 ms
12,160 KB
testcase_10 AC 84 ms
12,288 KB
testcase_11 AC 85 ms
12,288 KB
testcase_12 AC 86 ms
12,160 KB
testcase_13 AC 85 ms
12,160 KB
testcase_14 AC 86 ms
12,288 KB
testcase_15 AC 89 ms
12,032 KB
testcase_16 AC 86 ms
12,288 KB
testcase_17 AC 85 ms
12,160 KB
testcase_18 WA -
testcase_19 AC 86 ms
12,288 KB
testcase_20 WA -
testcase_21 AC 86 ms
12,288 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 86 ms
12,288 KB
testcase_25 AC 86 ms
12,160 KB
testcase_26 AC 86 ms
12,160 KB
testcase_27 AC 85 ms
12,288 KB
testcase_28 WA -
testcase_29 AC 86 ms
12,288 KB
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = []
n = gets.to_i
n.times do
  a += [gets.chomp!]
end
hash = a.inject(Hash.new(0)){|h, a| h[a] += 1; h}
hash = hash.sort
if  hash[0][1].to_i >= n/2
  puts "NO"
else
  puts "YES"
end
0