結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー yurarayurara
提出日時 2019-05-18 17:15:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 63 ms / 5,000 ms
コード長 350 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 11,828 KB
実行使用メモリ 12,040 KB
最終ジャッジ日時 2023-10-17 07:39:16
合計ジャッジ時間 2,968 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,172 KB
testcase_01 AC 63 ms
12,040 KB
testcase_02 AC 27 ms
10,100 KB
testcase_03 AC 27 ms
10,100 KB
testcase_04 AC 27 ms
10,100 KB
testcase_05 AC 58 ms
11,892 KB
testcase_06 AC 26 ms
10,100 KB
testcase_07 AC 27 ms
10,100 KB
testcase_08 AC 27 ms
10,100 KB
testcase_09 AC 27 ms
10,100 KB
testcase_10 AC 26 ms
10,100 KB
testcase_11 AC 27 ms
10,100 KB
testcase_12 AC 31 ms
10,100 KB
testcase_13 AC 27 ms
10,100 KB
testcase_14 AC 46 ms
10,928 KB
testcase_15 AC 35 ms
10,556 KB
testcase_16 AC 52 ms
11,344 KB
testcase_17 AC 34 ms
10,520 KB
testcase_18 AC 51 ms
11,136 KB
testcase_19 AC 45 ms
11,032 KB
testcase_20 AC 61 ms
11,892 KB
testcase_21 AC 28 ms
10,140 KB
testcase_22 AC 38 ms
10,604 KB
testcase_23 AC 58 ms
11,804 KB
testcase_24 AC 59 ms
11,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

_ = str(input())
L = list(map(int, input().split()))

lv = defaultdict()
lv.default_factory = lambda: 0

for l in L:
    lv[l] += 1

max_key, max_val = 0, 0
for item in lv.items():
    if item[1] > max_val or (item[1] == max_val and item[0] > max_key):
        max_key, max_val = item[0], item[1]

print(max_key)
0