結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,120 KB
testcase_01 AC 40 ms
10,092 KB
testcase_02 AC 15 ms
7,872 KB
testcase_03 AC 15 ms
7,836 KB
testcase_04 AC 15 ms
7,788 KB
testcase_05 AC 40 ms
10,000 KB
testcase_06 AC 15 ms
7,820 KB
testcase_07 AC 15 ms
7,812 KB
testcase_08 AC 15 ms
7,884 KB
testcase_09 AC 15 ms
7,812 KB
testcase_10 AC 15 ms
7,804 KB
testcase_11 AC 15 ms
7,732 KB
testcase_12 AC 16 ms
7,904 KB
testcase_13 AC 16 ms
7,876 KB
testcase_14 AC 30 ms
8,972 KB
testcase_15 AC 21 ms
8,528 KB
testcase_16 AC 34 ms
9,356 KB
testcase_17 AC 21 ms
8,584 KB
testcase_18 AC 33 ms
9,384 KB
testcase_19 AC 28 ms
9,200 KB
testcase_20 AC 41 ms
10,016 KB
testcase_21 AC 16 ms
7,788 KB
testcase_22 AC 24 ms
8,724 KB
testcase_23 AC 39 ms
9,676 KB
testcase_24 AC 40 ms
9,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    L = tuple(map(int, input().split()))

    survey = dict()
    for i in L:
        survey[i] = survey.get(i, 0) + 1

    maxv = 0
    maxk = 0
    for key, value in survey.items():
        if maxv < value:
            maxv = value
            maxk = key
        elif maxv == value and maxk < key:
            maxk = key

    print(maxk)

main()
0