結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー gemmarogemmaro
提出日時 2019-10-25 19:56:44
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 11,336 KB
実行使用メモリ 22,640 KB
最終ジャッジ日時 2023-09-29 01:19:37
合計ジャッジ時間 4,916 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
15,308 KB
testcase_01 WA -
testcase_02 AC 82 ms
15,272 KB
testcase_03 AC 83 ms
15,316 KB
testcase_04 AC 84 ms
15,116 KB
testcase_05 AC 136 ms
22,376 KB
testcase_06 AC 84 ms
15,124 KB
testcase_07 AC 84 ms
15,252 KB
testcase_08 AC 84 ms
15,176 KB
testcase_09 AC 84 ms
15,228 KB
testcase_10 AC 84 ms
15,080 KB
testcase_11 AC 83 ms
15,036 KB
testcase_12 AC 83 ms
15,116 KB
testcase_13 AC 84 ms
15,240 KB
testcase_14 AC 113 ms
19,032 KB
testcase_15 AC 96 ms
16,636 KB
testcase_16 AC 120 ms
20,380 KB
testcase_17 WA -
testcase_18 AC 120 ms
20,304 KB
testcase_19 AC 111 ms
18,812 KB
testcase_20 AC 138 ms
22,640 KB
testcase_21 AC 87 ms
15,236 KB
testcase_22 WA -
testcase_23 AC 135 ms
21,980 KB
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Main.rb:6: warning: assigned but unused variable - max_key
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i

l_s = gets.chomp.split.map &:to_i

extracts = {}
max_key = 0
max_value = 0
l_s.group_by{|i|i}.each{|key, value|
    if value.size >= max_value
        max_value = value.size
        extracts[key] = value.size
    end
}

max_num = 0
max_level = 0
extracts.each {|level, num|
    if num >= max_num and level > max_level
        max_num = num
        max_level = level
    end
}

p max_level
0