結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー mosmos_21mosmos_21
提出日時 2016-10-05 23:53:44
言語 C90
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 263 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 21,376 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-01 13:01:56
合計ジャッジ時間 2,522 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 RE -
testcase_02 AC 0 ms
6,944 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 WA -
testcase_05 RE -
testcase_06 AC 1 ms
6,940 KB
testcase_07 WA -
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 0 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 1 ms
6,948 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |   scanf("%d",&n);
      |   ^~~~~~~~~~~~~~
main.c:5:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |   for(;i<n;i++) scanf("%d", &h[i]);
      |                 ^~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main(){
  int n, h[10000],l[6]={0},ml=1,m,i=0;
  scanf("%d",&n);
  for(;i<n;i++) scanf("%d", &h[i]);
  for(;i;i--)l[h[i-1]-1]++;
  m=h[0];
  for(;i<6;i++)
    if(l[i]>=m){
      m=l[i];
      ml=i+1;
    }
  printf("%d\n",ml);
  return 0;
}
0