結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー rky
提出日時 2017-11-05 13:39:04
言語 Ruby
(3.4.1)
結果
AC  
実行時間 143 ms / 5,000 ms
コード長 261 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 19,584 KB
最終ジャッジ日時 2024-06-26 08:21:22
合計ジャッジ時間 3,507 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - test_case
Syntax OK

ソースコード

diff #

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