結果
| 問題 |
No.79 過小評価ダメ・ゼッタイ
|
| コンテスト | |
| ユーザー |
Ysmr_Ry
|
| 提出日時 | 2014-11-29 15:14:50 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 5,000 ms |
| コード長 | 316 bytes |
| コンパイル時間 | 301 ms |
| コンパイル使用メモリ | 22,912 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 07:15:52 |
| 合計ジャッジ時間 | 1,121 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf( "%d", &N );
| ~~~~~^~~~~~~~~~~~
main.cpp:14:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf( "%d", &L );
| ~~~~~^~~~~~~~~~~~
ソースコード
#include<cstdio>
#define rep(i,a) for(int i=0;i<(a);++i)
int cnt[6];
int main()
{
int N;
scanf( "%d", &N );
rep( i, N )
{
int L;
scanf( "%d", &L );
++cnt[L-1];
}
int ans, ma = 0;
rep( i, 6 ) if( ma <= cnt[i] )
ma = cnt[i], ans = i+1;
printf( "%d\n", ans );
return 0;
}
Ysmr_Ry