結果
問題 |
No.79 過小評価ダメ・ゼッタイ
|
ユーザー |
|
提出日時 | 2019-09-12 12:35:56 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 22 ms / 5,000 ms |
コード長 | 644 bytes |
コンパイル時間 | 727 ms |
コンパイル使用メモリ | 65,204 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 17:04:06 |
合計ジャッジ時間 | 1,557 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n; vector<int> v; cin >> n; int tmp; for (int i = 0; i < n; i++) { cin >> tmp >> std::ws; v.push_back(tmp); } sort(v.begin(), v.end()); v.push_back(-1); int ct = 0; int mx_ct = 0; int mx = 0; for (int j = 0; j < n; j++) { ct++; if (v.at(j) != v.at(j + 1)) { if (ct >= mx_ct) { mx_ct = ct; mx = v.at(j); } ct = 0; } } cout << mx << endl; }