結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー ksomemoksomemo
提出日時 2017-10-05 23:34:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 445 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 10,016 KB
最終ジャッジ日時 2023-09-08 15:16:08
合計ジャッジ時間 2,086 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,536 KB
testcase_01 AC 40 ms
9,852 KB
testcase_02 AC 18 ms
8,456 KB
testcase_03 AC 18 ms
8,496 KB
testcase_04 AC 17 ms
8,504 KB
testcase_05 AC 40 ms
9,744 KB
testcase_06 AC 18 ms
8,456 KB
testcase_07 AC 18 ms
8,600 KB
testcase_08 AC 19 ms
8,516 KB
testcase_09 AC 18 ms
8,460 KB
testcase_10 AC 18 ms
8,564 KB
testcase_11 AC 18 ms
8,456 KB
testcase_12 AC 18 ms
8,420 KB
testcase_13 AC 18 ms
8,560 KB
testcase_14 AC 30 ms
9,052 KB
testcase_15 AC 23 ms
8,992 KB
testcase_16 AC 34 ms
9,556 KB
testcase_17 AC 22 ms
8,780 KB
testcase_18 AC 34 ms
9,568 KB
testcase_19 AC 30 ms
9,188 KB
testcase_20 AC 40 ms
9,700 KB
testcase_21 AC 19 ms
8,524 KB
testcase_22 AC 25 ms
9,044 KB
testcase_23 AC 38 ms
9,436 KB
testcase_24 AC 38 ms
10,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter


def main():
    N = int(input())

    c = Counter(map(int, input().split()))
    mc = c.most_common()
    max_count = mc[0][1]
    m = filter(lambda t: t[1] == max_count, mc)
    # WA: すべて同じ個数だった時
    # 考慮できていない/Counterのkeyが辞書順とは限らない
    # level = list(m)[-1][0]
    level = max(dict(m).keys())
    print(level)

if __name__ == '__main__':
    main()
0