結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー testestesttestestest
提出日時 2016-02-26 20:20:58
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 177 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 21,468 KB
実行使用メモリ 4,368 KB
最終ジャッジ日時 2023-10-23 20:21:24
合計ジャッジ時間 5,580 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 155 ms
4,368 KB
testcase_01 WA -
testcase_02 AC 58 ms
4,368 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 151 ms
4,368 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 153 ms
4,368 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 131 ms
4,368 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 130 ms
4,368 KB
testcase_16 AC 150 ms
4,368 KB
testcase_17 AC 151 ms
4,368 KB
testcase_18 AC 151 ms
4,368 KB
testcase_19 AC 153 ms
4,368 KB
testcase_20 AC 154 ms
4,368 KB
testcase_21 AC 153 ms
4,368 KB
testcase_22 AC 136 ms
4,368 KB
testcase_23 AC 144 ms
4,368 KB
testcase_24 AC 0 ms
4,368 KB
testcase_25 WA -
testcase_26 AC 1 ms
4,368 KB
testcase_27 AC 2 ms
4,368 KB
testcase_28 AC 26 ms
4,368 KB
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:46: warning: return type defaults to ‘int’ [-Wimplicit-int]
    1 | double u=1e10,d=1e-10,m;long k,s,a[200010],i;main(t){for(;~scanf("%d",a+s);k=a[s++]);for(a[s-1]=0;t++<99;s>k?d=m:(u=m))for(s=i=1;a[i];s+=a[i++]/m)m=(u+d)/2;i=!printf("%.9f",u);}
      |                                              ^~~~
main.c: In function ‘main’:
main.c:1:46: warning: type of ‘t’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:60: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    1 | double u=1e10,d=1e-10,m;long k,s,a[200010],i;main(t){for(;~scanf("%d",a+s);k=a[s++]);for(a[s-1]=0;t++<99;s>k?d=m:(u=m))for(s=i=1;a[i];s+=a[i++]/m)m=(u+d)/2;i=!printf("%.9f",u);}
      |                                                            ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | double u=1e10,d=1e-10,m;long k,s,a[200010],i;main(t){for(;~scanf("%d",a+s);k=a[s++]);for(a[s-1]=0;t++<99;s>k?d=m:(u=m))for(s=i=1;a[i];s+=a[i++]/m)m=(u+d)/2;i=!printf("%.9f",u);}
main.c:1:60: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    1 | double u=1e10,d=1e-10,m;long k,s,a[200010],i;main(t){for(;~scanf("%d",a+s);k=a[s++]);for(a[s-1]=0;t++<99;s>k?d=m:(u=m))for(s=i=1;a[i];s+=a[i++]/m)m=(u+d)/2;i=!printf("%.9f",u);}
      |                                                            ^~~~~
main.c:1:60: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:1:68: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long int *’ [-Wformat=]
    1 | double u=1e10,d=1e-10,m;long k,s,a[200010],i;main(t){for(;~scanf("%d",a+s);k=a[s++]);for(a[s-1]=0;t++<99;s>k?d=m:(u=m))for(s=i=1;a[i];s+=a[i++]/m)m=(u+d)/2;i=!printf("%.9f",u);}
      |                                                                   ~^  ~~~
      |                                                   

ソースコード

diff #

double u=1e10,d=1e-10,m;long k,s,a[200010],i;main(t){for(;~scanf("%d",a+s);k=a[s++]);for(a[s-1]=0;t++<99;s>k?d=m:(u=m))for(s=i=1;a[i];s+=a[i++]/m)m=(u+d)/2;i=!printf("%.9f",u);}
0