結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー mokrai
提出日時 2017-11-01 22:17:32
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 447 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 12,648 KB
最終ジャッジ日時 2024-06-26 08:21:12
合計ジャッジ時間 1,963 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    num = int(input())
    levels = list(map(int, input().split()))

    max_count = 1
    ans_level = 0
    for i in set(levels):
        count = levels.count(i)
        #print("count", count)
        if count > max_count: 
            max_count = count
            ans_level = i
        elif count == max_count:
            if i > ans_level:
                ans_level = i

    print(ans_level)


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