結果

問題 No.25 有限小数
ユーザー beetbeet
提出日時 2018-12-02 11:13:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 320 bytes
コンパイル時間 2,335 ms
コンパイル使用メモリ 86,576 KB
実行使用メモリ 71,644 KB
最終ジャッジ日時 2023-09-10 22:55:48
合計ジャッジ時間 5,045 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,412 KB
testcase_01 AC 76 ms
71,372 KB
testcase_02 AC 75 ms
71,508 KB
testcase_03 AC 75 ms
71,408 KB
testcase_04 AC 74 ms
71,284 KB
testcase_05 AC 76 ms
71,200 KB
testcase_06 AC 75 ms
71,192 KB
testcase_07 AC 75 ms
71,528 KB
testcase_08 AC 75 ms
71,344 KB
testcase_09 AC 74 ms
71,124 KB
testcase_10 AC 75 ms
71,524 KB
testcase_11 AC 74 ms
71,644 KB
testcase_12 AC 74 ms
71,348 KB
testcase_13 AC 73 ms
71,260 KB
testcase_14 AC 74 ms
71,376 KB
testcase_15 AC 73 ms
71,284 KB
testcase_16 AC 74 ms
71,532 KB
testcase_17 AC 75 ms
71,532 KB
testcase_18 AC 74 ms
71,168 KB
testcase_19 AC 74 ms
71,096 KB
testcase_20 AC 74 ms
71,124 KB
testcase_21 AC 73 ms
71,376 KB
testcase_22 WA -
testcase_23 AC 73 ms
71,084 KB
testcase_24 AC 73 ms
71,368 KB
testcase_25 AC 73 ms
71,404 KB
testcase_26 AC 72 ms
71,256 KB
testcase_27 AC 74 ms
71,184 KB
testcase_28 AC 73 ms
71,352 KB
testcase_29 AC 73 ms
71,196 KB
testcase_30 AC 74 ms
71,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
m = int(input())

x = m
t = 0
f = 0

while x % 2 == 0:
    x = x // 2
    t = t + 1

while x % 5 == 0:
    x = x // 5
    f = f + 1
    
while t < f:
    n *= 2
    m *= 2
    t += 1

while t > f:
    n *= 5
    m *= 5
    f += 1

while n % 10 == 0:
    n = n // 10
    
print(n % 10 if x == 1 else -1)
0