結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー mesh1nek0x0mesh1nek0x0
提出日時 2018-07-11 23:41:45
言語 Ruby
(3.3.0)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 297 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 11,908 KB
実行使用メモリ 22,936 KB
最終ジャッジ日時 2023-10-22 02:16:53
合計ジャッジ時間 4,465 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
16,132 KB
testcase_01 AC 113 ms
22,588 KB
testcase_02 AC 76 ms
16,128 KB
testcase_03 AC 76 ms
16,128 KB
testcase_04 AC 72 ms
16,128 KB
testcase_05 AC 113 ms
22,684 KB
testcase_06 AC 74 ms
16,128 KB
testcase_07 AC 72 ms
16,128 KB
testcase_08 AC 75 ms
16,128 KB
testcase_09 AC 76 ms
16,128 KB
testcase_10 AC 76 ms
16,128 KB
testcase_11 AC 71 ms
16,124 KB
testcase_12 AC 74 ms
16,128 KB
testcase_13 AC 73 ms
16,128 KB
testcase_14 AC 97 ms
19,732 KB
testcase_15 AC 87 ms
17,524 KB
testcase_16 AC 102 ms
20,832 KB
testcase_17 AC 83 ms
17,344 KB
testcase_18 AC 99 ms
20,664 KB
testcase_19 AC 97 ms
19,400 KB
testcase_20 AC 112 ms
22,936 KB
testcase_21 AC 77 ms
16,128 KB
testcase_22 AC 87 ms
18,220 KB
testcase_23 AC 111 ms
22,336 KB
testcase_24 AC 117 ms
22,500 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/bin/ruby
N = gets.chomp.to_i
L = gets.chomp.split(' ')

groups = L.group_by { |num| num }

max_lv = 0
max = 0
groups.each do |lv, value|
  if max < value.count
    max_lv = lv.to_i
    max = value.count
  elsif max === value.count && max_lv < lv.to_i
    max_lv = lv.to_i
  end
end

puts max_lv
0