結果
| 問題 |
No.79 過小評価ダメ・ゼッタイ
|
| コンテスト | |
| ユーザー |
a
|
| 提出日時 | 2014-11-27 23:23:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 5,000 ms |
| コード長 | 331 bytes |
| コンパイル時間 | 1,430 ms |
| コンパイル使用メモリ | 157,008 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 07:12:22 |
| 合計ジャッジ時間 | 2,236 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
main.cpp:11:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d",&l);
| ~~~~~^~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
int n;
int lv[7] = {}, l;
scanf("%d",&n);
for( int i = 0; i < n; i++ ) {
scanf("%d",&l);
lv[l] += 1;
}
int res = 1;
for( int i = 1; i <= 6; i++ ) {
if( lv[res] <= lv[i] ) res = i;
}
printf("%d\n",res);
return 0;
}
a