結果

問題 No.25 有限小数
コンテスト
ユーザー testestest
提出日時 2016-04-05 23:10:11
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 154 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 121 ms
コンパイル使用メモリ 29,384 KB
最終ジャッジ日時 2026-02-23 21:04:36
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:1:25: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    1 | long a,b,s,t;main(){for(scanf("%ld",&b);~b&1?b/=2,++t:b%5<1?b/=5,++s:0;);a?a=!printf("%d",a%b?-1:s<t?5:a/b*(s-t?1<<(s-t)%4+4:1)%10):main(a=b,s^=t^=s^=t);}
      |                         ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | long a,b,s,t;main(){for(scanf("%ld",&b);~b&1?b/=2,++t:b%5<1?b/=5,++s:0;);a?a=!printf("%d",a%b?-1:s<t?5:a/b*(s-t?1<<(s-t)%4+4:1)%10):main(a=b,s^=t^=s^=t);}
main.c:1:79: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
    1 | long a,b,s,t;main(){for(scanf("%ld",&b);~b&1?b/=2,++t:b%5<1?b/=5,++s:0;);a?a=!printf("%d",a%b?-1:s<t?5:a/b*(s-t?1<<(s-t)%4+4:1)%10):main(a=b,s^=t^=s^=t);}
      |                                                                               ^~~~~~
main.c:1:79: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:1:88: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
    1 | long a,b,s,t;main(){for(scanf("%ld",&b);~b&1?b/=2,++t:b%5<1?b/=5,++s:0;);a?a=!printf("%d",a%b?-1:s<t?5:a/b*(s-t?1<<(s-t)%4+4:1)%10):main(a=b,s^=t^=s^=t);}
      |                                                                                       ~^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                        |        |
      |                                                                                        int      long int
      |                                                                                       %ld

ソースコード

diff #
raw source code

long a,b,s,t;main(){for(scanf("%ld",&b);~b&1?b/=2,++t:b%5<1?b/=5,++s:0;);a?a=!printf("%d",a%b?-1:s<t?5:a/b*(s-t?1<<(s-t)%4+4:1)%10):main(a=b,s^=t^=s^=t);}
0