結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー ふう
提出日時 2015-01-26 15:27:45
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 628 bytes
コンパイル時間 714 ms
コンパイル使用メモリ 82,424 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-26 07:26:40
合計ジャッジ時間 1,623 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <map>
#include <list>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <iomanip>

using namespace std;

int main(void)
{
	int L[6];
	int n;
	int x;
	int ma = 0;

	cin >> n;

	memset(L, 0, sizeof(L));

	for (int i = 0; i < n; i++) {
		cin >> x;
		L[x - 1]++;
	}
	for (int i = 0; i < 6; i++) {
		ma = max(ma, L[i]);
	}

	for (int i = 5; i >= 0; i--) {
		if(L[i] == ma) {
			cout << i + 1 <<endl;
			break;
		}
	}

	
	

	

	return (0);
}
0