結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー Drafear
提出日時 2016-01-18 16:39:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 1,444 ms
コンパイル使用メモリ 166,668 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 07:47:24
合計ジャッジ時間 2,452 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> P;

int main() {
	vector<int> v(6, 0);
	int N; cin >> N;
	for (int i = 0; i < N; ++i) {
		int L; cin >> L;
		v[L-1]++;
	}
	vector<P> a;
	for (int i = 0; i < v.size(); ++i) {
		a.push_back( P(v[i], i) );
	}
	sort(a.begin(), a.end(), greater<P>());
	cout << a[0].second+1 << endl;
}
0