結果

問題 No.349 干支の置き物
ユーザー wonda_t_coffeewonda_t_coffee
提出日時 2020-02-03 20:58:13
言語 Ruby
(3.2.2)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 202 bytes
コンパイル時間 41 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 15,936 KB
最終ジャッジ日時 2023-10-19 09:43:48
合計ジャッジ時間 3,906 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

n = gets.chomp.to_i
a = []
h = {}
n.times do
  ai = gets.chomp
  a << ai

  h[ai] ||= 0
  h[ai] += 1
end
max = 0
h.keys.each do |key|
  max = [max, h[key]].max
end
puts (n + 1) / 2 < max ? 'NO' : 'YES'
0