結果
| 問題 |
No.79 過小評価ダメ・ゼッタイ
|
| コンテスト | |
| ユーザー |
siguma323
|
| 提出日時 | 2016-05-09 21:49:33 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 5,000 ms |
| コード長 | 837 bytes |
| コンパイル時間 | 923 ms |
| コンパイル使用メモリ | 87,452 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 07:55:19 |
| 合計ジャッジ時間 | 1,866 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <list>
#include <map>
#include <queue>
#include <iterator>
#include <cmath>
#include <iomanip>
using namespace std;
using ull = unsigned long long;
using ll = long long;
int main()
{
int n;
cin >> n;
vector<int> l(n);
for(auto&& x : l) cin >> x;
vector<int> check_l = l;
sort(check_l.begin(),check_l.end());
check_l.erase(unique(check_l.begin(),check_l.end()),check_l.end());
int max_num = 0;
int maximum = 0;
for(auto&& x : check_l)
{
int tmp = count(l.begin(),l.end(),x);
if(tmp >= maximum)
{
maximum = tmp;
max_num = x;
}
}
cout << max_num << endl;
}
siguma323