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