結果

問題 No.67 よくある棒を切る問題 (1)
コンテスト
ユーザー testestest
提出日時 2016-02-26 20:20:58
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 177 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 244 ms
コンパイル使用メモリ 30,024 KB
最終ジャッジ日時 2026-02-23 20:46:58
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
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: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: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);}
      |                                                                   ~^  ~~~
      |                                                                    |   |
      |                                                                    |   long int *
      |                                                                    int *
      |                                                                   %ld
main.c:1:160: warning: incompatible implicit declaration of built-in function ‘printf’ [-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:160: note: include ‘<stdio.h>’ or provide a declaration of ‘printf

ソースコード

diff #
raw source code

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