結果
| 問題 |
No.79 過小評価ダメ・ゼッタイ
|
| コンテスト | |
| ユーザー |
d2verb
|
| 提出日時 | 2015-05-05 09:41:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 5,000 ms |
| コード長 | 804 bytes |
| コンパイル時間 | 764 ms |
| コンパイル使用メモリ | 91,308 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 07:32:44 |
| 合計ジャッジ時間 | 1,694 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <limits>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <complex>
using namespace std;
#define INF (INT_MAX/3)
#define PI (2*acos(0.0))
#define EPS (1e-8)
typedef long long ll;
typedef unsigned long long ull;
int L[7];
int main(){
ios_base::sync_with_stdio(0);
int N, l;
cin >> N;
map<int, int> L;
int maxcnt = 0, ans = 0;
for(int i = 0; i < N; i++){
cin >> l;
L[l]++;
if(maxcnt < L[l] || (maxcnt == L[l] && l > ans)) { maxcnt = L[l]; ans = l;}
}
cout << ans << endl;
return 0;
}
d2verb