結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー TLwiegehtt
提出日時 2015-07-07 05:35:13
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 340 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 20,480 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-08 01:27:53
合計ジャッジ時間 1,308 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%d", &n);
      |         ^~~~~~~~~~~~~~~
main.c:12:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |                 scanf("%d", &l);
      |                 ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void){
	int i,l,n;
	int rank[10];
	int maxNum = 0;
	int maxLevel = 0;
	for(i=0;i<10;i++){rank[i]=0;}
	scanf("%d", &n);
	
	for(i=0;i<n;i++){
		scanf("%d", &l);
		rank[l]++;
		if(maxNum <= rank[l]){
			maxNum = rank[l];
			if(maxLevel < l ){
				maxLevel = l;
			}
		}
	}
	
	printf("%d\n", maxLevel);
	return 0;
}
0