結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー osyo-mangaosyo-manga
提出日時 2023-08-04 18:31:50
言語 Ruby
(3.3.0)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 356 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 19,712 KB
最終ジャッジ日時 2024-04-22 16:30:48
合計ジャッジ時間 3,383 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
12,160 KB
testcase_01 AC 132 ms
19,328 KB
testcase_02 AC 83 ms
12,288 KB
testcase_03 AC 82 ms
12,288 KB
testcase_04 AC 85 ms
12,160 KB
testcase_05 AC 124 ms
19,584 KB
testcase_06 AC 84 ms
12,288 KB
testcase_07 AC 83 ms
12,288 KB
testcase_08 AC 85 ms
12,160 KB
testcase_09 AC 83 ms
12,288 KB
testcase_10 AC 80 ms
12,288 KB
testcase_11 AC 82 ms
12,160 KB
testcase_12 AC 82 ms
12,288 KB
testcase_13 AC 82 ms
12,032 KB
testcase_14 AC 111 ms
16,768 KB
testcase_15 AC 96 ms
13,312 KB
testcase_16 AC 118 ms
18,176 KB
testcase_17 AC 93 ms
13,312 KB
testcase_18 AC 115 ms
18,048 KB
testcase_19 AC 104 ms
15,872 KB
testcase_20 AC 127 ms
19,712 KB
testcase_21 AC 86 ms
12,032 KB
testcase_22 AC 99 ms
14,592 KB
testcase_23 AC 127 ms
19,200 KB
testcase_24 AC 127 ms
19,328 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# 入力された値を受け取る
N = gets.chomp.to_i
Ls = gets.chomp.split.map(&:to_i)
# => [5, 3, 5, 6, 3, 6, 3]

# [評価の人数, 評価] の配列に変換して、その値でソートする
values = Ls.uniq.map { [Ls.count(_1), _1] }
# => [[2, 5], [3, 3], [2, 6]]

sorted = values.sort
# => [[2, 5], [2, 6], [3, 3]]

puts sorted.last.last
# => 3
0