結果
問題 | No.79 過小評価ダメ・ゼッタイ |
ユーザー |
![]() |
提出日時 | 2014-11-27 23:45:13 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 11 ms / 5,000 ms |
コード長 | 562 bytes |
コンパイル時間 | 775 ms |
コンパイル使用メモリ | 70,868 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 07:14:06 |
合計ジャッジ時間 | 1,652 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:18:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 18 | scanf("%d",&n); | ~~~~~^~~~~~~~~ main.cpp:21:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 21 | scanf("%d",&in); | ~~~~~^~~~~~~~~~
ソースコード
#include <cstdio> #include <cstdlib> #include <iostream> #include <string> #include <cmath> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <map> using namespace std; int main(){ int in,n,nan[7]={0},ans=0,max_n=0; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&in); nan[in]++; } for(int i=1;i<=6;i++){ if(max_n<=nan[i]){ max_n=nan[i]; ans=i; } } printf("%d\n",ans); return 0; }