結果

問題 No.25 有限小数
ユーザー testestesttestestest
提出日時 2016-02-13 21:35:06
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 182 bytes
コンパイル時間 650 ms
コンパイル使用メモリ 20,692 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 05:01:42
合計ジャッジ時間 1,365 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 0 ms
4,348 KB
testcase_06 WA -
testcase_07 AC 1 ms
4,348 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 0 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 WA -
testcase_18 AC 0 ms
4,348 KB
testcase_19 AC 0 ms
4,348 KB
testcase_20 AC 0 ms
4,348 KB
testcase_21 AC 1 ms
4,348 KB
testcase_22 AC 0 ms
4,348 KB
testcase_23 AC 0 ms
4,348 KB
testcase_24 AC 1 ms
4,348 KB
testcase_25 AC 0 ms
4,348 KB
testcase_26 AC 1 ms
4,348 KB
testcase_27 AC 0 ms
4,348 KB
testcase_28 AC 1 ms
4,348 KB
testcase_29 AC 0 ms
4,348 KB
testcase_30 AC 0 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:16: warning: return type defaults to ‘int’ [-Wimplicit-int]
    1 | long a,b,p,q,t;main(){scanf("%ld%ld",&a,&b);for(p=a,t=b;q=t;p=q)t=p%q;for(a/=p;a%(q=10)<1;a/=q);for(b/=p;b%q<1;b/=q);for(t=b%2*3+2;b%t<1;a=a*2)b/=t;a=!printf("%d",b-1?-1:t-2?a%q:5);}
      |                ^~~~
main.c: In function ‘main’:
main.c:1:23: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    1 | long a,b,p,q,t;main(){scanf("%ld%ld",&a,&b);for(p=a,t=b;q=t;p=q)t=p%q;for(a/=p;a%(q=10)<1;a/=q);for(b/=p;b%q<1;b/=q);for(t=b%2*3+2;b%t<1;a=a*2)b/=t;a=!printf("%d",b-1?-1:t-2?a%q:5);}
      |                       ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | long a,b,p,q,t;main(){scanf("%ld%ld",&a,&b);for(p=a,t=b;q=t;p=q)t=p%q;for(a/=p;a%(q=10)<1;a/=q);for(b/=p;b%q<1;b/=q);for(t=b%2*3+2;b%t<1;a=a*2)b/=t;a=!printf("%d",b-1?-1:t-2?a%q:5);}
main.c:1:23: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    1 | long a,b,p,q,t;main(){scanf("%ld%ld",&a,&b);for(p=a,t=b;q=t;p=q)t=p%q;for(a/=p;a%(q=10)<1;a/=q);for(b/=p;b%q<1;b/=q);for(t=b%2*3+2;b%t<1;a=a*2)b/=t;a=!printf("%d",b-1?-1:t-2?a%q:5);}
      |                       ^~~~~
main.c:1:23: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:1:152: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
    1 | long a,b,p,q,t;main(){scanf("%ld%ld",&a,&b);for(p=a,t=b;q=t;p=q)t=p%q;for(a/=p;a%(q=10)<1;a/=q);for(b/=p;b%q<1;b/=q);for(t=b%2*3+2;b%t<1;a=a*2)b/=t;a=!printf("%d",b-1?-1:t-2?a%q:5);}
      |                                                                                                                                                        ^~~~~~
main.c:1:152: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:1:152: warning: incompatible implicit declaration of built-in fu

ソースコード

diff #

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