結果
問題 | No.25 有限小数 |
ユーザー |
![]() |
提出日時 | 2020-06-11 22:48:26 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 37 ms / 5,000 ms |
コード長 | 469 bytes |
コンパイル時間 | 129 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-24 03:29:19 |
合計ジャッジ時間 | 2,150 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) m=int(input()) if n%m==0: nm=str(n//m) for nn in nm[::-1]: if nn=="0": continue else: print(nn) break else: while True: if m%5==0: m//=5 n*=2 elif m%2==0: m//=2 n*=5 else: break if m==1: n=str(n) for nn in n[::-1]: if nn=="0": continue else: print(nn) break else: print(-1)