結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー osyo-mangaosyo-manga
提出日時 2023-07-21 18:13:52
言語 Ruby
(3.3.0)
結果
AC  
実行時間 143 ms / 5,000 ms
コード長 350 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 11,836 KB
実行使用メモリ 23,280 KB
最終ジャッジ日時 2023-10-21 18:36:37
合計ジャッジ時間 3,816 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
15,960 KB
testcase_01 AC 143 ms
23,196 KB
testcase_02 AC 90 ms
15,948 KB
testcase_03 AC 94 ms
15,948 KB
testcase_04 AC 93 ms
15,948 KB
testcase_05 AC 137 ms
23,280 KB
testcase_06 AC 89 ms
15,948 KB
testcase_07 AC 90 ms
15,948 KB
testcase_08 AC 90 ms
15,948 KB
testcase_09 AC 90 ms
15,948 KB
testcase_10 AC 87 ms
15,948 KB
testcase_11 AC 87 ms
15,948 KB
testcase_12 AC 89 ms
15,952 KB
testcase_13 AC 89 ms
15,948 KB
testcase_14 AC 118 ms
19,820 KB
testcase_15 AC 102 ms
17,464 KB
testcase_16 AC 124 ms
21,440 KB
testcase_17 AC 101 ms
17,280 KB
testcase_18 AC 125 ms
21,272 KB
testcase_19 AC 115 ms
19,480 KB
testcase_20 AC 143 ms
23,280 KB
testcase_21 AC 92 ms
15,948 KB
testcase_22 AC 109 ms
18,564 KB
testcase_23 AC 142 ms
22,604 KB
testcase_24 AC 141 ms
23,108 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
0