結果
問題 |
No.79 過小評価ダメ・ゼッタイ
|
ユーザー |
|
提出日時 | 2025-07-06 14:17:41 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 57 ms / 5,000 ms |
コード長 | 523 bytes |
コンパイル時間 | 881 ms |
コンパイル使用メモリ | 12,032 KB |
実行使用メモリ | 12,032 KB |
最終ジャッジ日時 | 2025-07-06 14:17:45 |
合計ジャッジ時間 | 3,662 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
def main(): N = int(input()) A = list(map(int, input().split())) freq = {} max_count = 0 ans = [] for num in A: if num in freq: freq[num] += 1 else: freq[num] = 1 for key in freq: if freq[key] > max_count: max_count = freq[key] ans = [key] elif freq[key] == max_count: ans.append(key) if len(ans) == 1: print(ans[0]) else: print(max(ans)) if __name__=='__main__': main()