結果

問題 No.79 過小評価ダメ・ゼッタイ
コンテスト
ユーザー rky
提出日時 2017-11-05 13:39:04
言語 Ruby
(4.0.1)
コンパイル:
ruby -w -c _filename_
実行:
ruby _filename_
結果
AC  
実行時間 89 ms / 5,000 ms
コード長 261 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 156 ms
コンパイル使用メモリ 9,088 KB
実行使用メモリ 21,760 KB
最終ジャッジ日時 2026-03-13 00:16:36
合計ジャッジ時間 2,535 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - test_case
Syntax OK

ソースコード

diff #
raw source code

test_case = gets.chomp.to_i
list = gets.chomp.split.map(&:to_i)
list_uniq = list.uniq()
list_count = Array.new
answer = Array.new

list_uniq.each{|i| list_count << list.count(i)}
list_uniq.each{|i| answer << i if list.count(i) == list_count.max}
puts answer.max
0