結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー ミドリムシ
提出日時 2017-10-14 04:02:26
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 413 bytes
コンパイル時間 526 ms
コンパイル使用メモリ 58,384 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 08:20:14
合計ジャッジ時間 1,459 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;
 
int main(){
	int N;
	cin >> N;
	int answers[6];
	for(int i = 0; i < 6; i++){
		answers[i] = 0;
	}
	for(int i = 0; i < N; i++){
		int level;
		cin >> level;
		answers[level - 1]++;
	}
	int max = answers[0];
	int max_num = 1;
	for(int i = 1; i < 6; i++){
		if(max <= answers[i]){
			max = answers[i];
			max_num = i + 1;
		}
	}
	cout << max_num << endl;
}
0