結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー piyoko_212
提出日時 2015-12-28 23:29:03
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 9 ms / 5,000 ms
コード長 246 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 33,740 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 07:46:03
合計ジャッジ時間 1,060 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         int a;scanf("%d",&a);
      |               ~~~~~^~~~~~~~~
main.cpp:8:28: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |                 int p;scanf("%d",&p);t[p]++;
      |                       ~~~~~^~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<algorithm>
using namespace std;
int t[10];
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++){
		int p;scanf("%d",&p);t[p]++;
	}
	int ret=6;
	for(int i=5;i>0;i--){
		if(t[ret]<t[i])ret=i;
	}
	printf("%d\n",ret);
}
0