結果

問題 No.25 有限小数
ユーザー ntuda
提出日時 2024-12-24 00:07:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 255 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 82,240 KB
実行使用メモリ 54,152 KB
最終ジャッジ日時 2024-12-24 00:07:33
合計ジャッジ時間 2,437 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
M = int(input())
X2 = 0
M2 = M
while M2 % 2 == 0:
    M2 //= 2
    N *= 5
while M2 % 5 == 0:
    M2 //= 5
    N *= 2
if M2 != 1:
    print(-1)
    exit()
S = str(N)
for s in reversed(S):
    if s != "0":
        print(s)
        exit()


0