結果
| 問題 |
No.79 過小評価ダメ・ゼッタイ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-22 00:54:47 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 5,000 ms |
| コード長 | 467 bytes |
| コンパイル時間 | 1,316 ms |
| コンパイル使用メモリ | 159,732 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 08:22:00 |
| 合計ジャッジ時間 | 2,049 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:27:13: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized]
27 | cout << ans << endl;
| ^~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
int cnt[6] = {};
REP(i, N) {
int t;
cin >> t;
cnt[t - 1]++;
}
int ans, tempMax = 0;
REP(i, 6) {
if (cnt[i] >= tempMax) {
tempMax = cnt[i];
ans = i + 1;
}
}
cout << ans << endl;
return 0;
}