結果
問題 | No.79 過小評価ダメ・ゼッタイ |
ユーザー |
![]() |
提出日時 | 2015-07-07 05:39:26 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 9 ms / 5,000 ms |
コード長 | 365 bytes |
コンパイル時間 | 120 ms |
コンパイル使用メモリ | 20,480 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 07:37:44 |
合計ジャッジ時間 | 987 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
コンパイルメッセージ
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); | ^~~~~~~~~~~~~~~
ソースコード
#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]++; } for(i=0;i<10;i++){ if(maxNum <= rank[i]){ maxNum = rank[i]; if(maxLevel < i ){ maxLevel = i; } } } printf("%d\n", maxLevel); return 0; }