結果
問題 | No.25 有限小数 |
ユーザー |
![]() |
提出日時 | 2021-04-02 12:50:50 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 5,000 ms |
コード長 | 312 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-12-23 06:48:50 |
合計ジャッジ時間 | 2,061 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
import math num = int(input()) den = int(input()) g = math.gcd(num,den) num //= g den //= g d = den + 0 while d % 5 == 0: d //= 5 while d % 2 == 0: d //= 2 if d != 1: print(-1) exit(0) while num % den != 0: num *= 10 res = num // den while res % 10 == 0: res //= 10 print(res%10)