結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー takeytakey
提出日時 2018-04-05 22:31:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 109 ms / 5,000 ms
コード長 549 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 10,604 KB
実行使用メモリ 10,100 KB
最終ジャッジ日時 2023-09-08 17:52:09
合計ジャッジ時間 2,765 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,252 KB
testcase_01 AC 91 ms
10,100 KB
testcase_02 AC 16 ms
7,856 KB
testcase_03 AC 16 ms
7,948 KB
testcase_04 AC 15 ms
7,932 KB
testcase_05 AC 109 ms
9,920 KB
testcase_06 AC 15 ms
7,828 KB
testcase_07 AC 15 ms
7,900 KB
testcase_08 AC 15 ms
7,784 KB
testcase_09 AC 15 ms
7,824 KB
testcase_10 AC 15 ms
7,856 KB
testcase_11 AC 16 ms
7,892 KB
testcase_12 AC 15 ms
7,816 KB
testcase_13 AC 15 ms
7,816 KB
testcase_14 AC 58 ms
9,100 KB
testcase_15 AC 33 ms
8,756 KB
testcase_16 AC 70 ms
9,480 KB
testcase_17 AC 31 ms
8,548 KB
testcase_18 AC 69 ms
9,200 KB
testcase_19 AC 55 ms
9,224 KB
testcase_20 AC 88 ms
9,992 KB
testcase_21 AC 18 ms
7,920 KB
testcase_22 AC 41 ms
8,740 KB
testcase_23 AC 85 ms
9,724 KB
testcase_24 AC 85 ms
9,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

if __name__ == "__main__":
    N = int(input())
    L = list(map(int, input().split()))
    ans = {}
    # 回答する
    ans[L[0]] = 1
    max_key = L[0]
    max_val = 1
    for i in range(1, len(L)):
        if L[i] in ans:
            ans[L[i]] += 1
            if ans[L[i]] > max_val:
                max_key = L[i]
                max_val = ans[L[i]]
        else:
            ans[L[i]] = 1
        if ans[L[i]] == max_val:
            if L[i] > max_key:
                max_key = L[i]
                max_val = ans[L[i]]
    print(max_key)
0