結果
問題 |
No.79 過小評価ダメ・ゼッタイ
|
ユーザー |
![]() |
提出日時 | 2019-02-06 23:43:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 16 ms / 5,000 ms |
コード長 | 533 bytes |
コンパイル時間 | 1,589 ms |
コンパイル使用メモリ | 164,632 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 04:31:56 |
合計ジャッジ時間 | 2,493 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { // 1. 入力情報取得. int N; cin >> N; // ユーザーからの回答を保管. map<int, int> m; for(int i = 0; i < N; i++){ int L; cin >> L; m[L]++; } // 2. 文字の配列として保存し, sort. int ans = 0; int maxUserCount = 0; for(auto &p : m) if(maxUserCount <= p.second) maxUserCount = p.second, ans = p.first; // 3. 後処理. cout << ans << endl; return 0; }