結果
問題 | No.25 有限小数 |
ユーザー | 👑 testestest |
提出日時 | 2015-08-13 04:09:06 |
言語 | C90 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 239 bytes |
コンパイル時間 | 1,282 ms |
コンパイル使用メモリ | 20,352 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-18 09:11:31 |
合計ジャッジ時間 | 811 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 0 ms
6,812 KB |
testcase_01 | AC | 0 ms
6,940 KB |
testcase_02 | AC | 0 ms
6,940 KB |
testcase_03 | AC | 0 ms
6,940 KB |
testcase_04 | AC | 0 ms
6,940 KB |
testcase_05 | AC | 1 ms
6,940 KB |
testcase_06 | AC | 0 ms
6,940 KB |
testcase_07 | WA | - |
testcase_08 | AC | 0 ms
6,944 KB |
testcase_09 | AC | 0 ms
6,940 KB |
testcase_10 | AC | 0 ms
6,944 KB |
testcase_11 | WA | - |
testcase_12 | AC | 0 ms
6,940 KB |
testcase_13 | AC | 0 ms
6,940 KB |
testcase_14 | AC | 0 ms
6,940 KB |
testcase_15 | WA | - |
testcase_16 | AC | 1 ms
6,940 KB |
testcase_17 | AC | 0 ms
6,944 KB |
testcase_18 | AC | 0 ms
6,940 KB |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 1 ms
6,944 KB |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | AC | 0 ms
6,940 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | AC | 0 ms
6,944 KB |
コンパイルメッセージ
main.c: In function ‘main’: main.c:3:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 3 | scanf("%ld%ld",&a,&b); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | int main(){ main.c:3:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 3 | scanf("%ld%ld",&a,&b); | ^~~~~ main.c:3:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:4:34: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 4 | if(a%b<1){for(a/=b;a%10<1;a/=10);printf("%d",a%10);return 0;} | ^~~~~~ main.c:4:34: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:4:34: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:4:34: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:4:43: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] 4 | if(a%b<1){for(a/=b;a%10<1;a/=10);printf("%d",a%10);return 0;} | ~^ ~~~~ | | | | int long int | %ld main.c:7:10: warning: implicit declaration of function ‘puts’ [-Wimplicit-function-declaration] 7 | if(b%2<1)puts("5");else{for(a%=10;b&b-1;a*=2)b/=5;printf("%d",b?a%10:-1);} | ^~~~ main.c:7:10: note: include ‘<stdio.h>’ or provide a declaration of ‘puts’ main.c:7:51: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] 7 | if(b%2<1)puts("5");else{for(a%=10;b&b-1;a*=2)b/=5;printf("%d",b?a%10:-1);} |
ソースコード
int main(){ long a,b,p,q,t; scanf("%ld%ld",&a,&b); if(a%b<1){for(a/=b;a%10<1;a/=10);printf("%d",a%10);return 0;} for(p=a,q=b;q;q=t)t=p%q,p=q; a/=p;b/=p; if(b%2<1)puts("5");else{for(a%=10;b&b-1;a*=2)b/=5;printf("%d",b?a%10:-1);} return 0; }