結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー rio-yuasario-yuasa
提出日時 2023-07-31 21:04:49
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 18,816 KB
最終ジャッジ日時 2024-04-18 20:44:31
合計ジャッジ時間 3,919 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 79 ms
12,160 KB
testcase_04 AC 79 ms
12,160 KB
testcase_05 AC 110 ms
18,560 KB
testcase_06 AC 80 ms
12,288 KB
testcase_07 AC 77 ms
12,160 KB
testcase_08 WA -
testcase_09 AC 79 ms
12,160 KB
testcase_10 AC 82 ms
12,160 KB
testcase_11 AC 78 ms
12,288 KB
testcase_12 AC 83 ms
12,032 KB
testcase_13 AC 81 ms
12,160 KB
testcase_14 WA -
testcase_15 AC 86 ms
13,312 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 102 ms
15,232 KB
testcase_20 AC 119 ms
18,816 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.chomp.to_i
Ls = gets.chomp.split.map(&:to_i)

#  最大の件数がいくつあるかを数える
max_count = Ls.count(Ls.max)

# 最大の件数が1つだけの場合は puts する
if max_count == 1
    puts Ls.max
# 最大の件数が2つ以上ある場合は、大きい方をputsする  
else
    puts Ls.max(2)[1]
end
0