結果
問題 | No.25 有限小数 |
ユーザー |
|
提出日時 | 2023-06-13 16:51:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 39 ms / 5,000 ms |
コード長 | 216 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 82,600 KB |
実行使用メモリ | 54,304 KB |
最終ジャッジ日時 | 2024-06-22 02:11:46 |
合計ジャッジ時間 | 2,048 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
import math N = int(input()) M = int(input()) N *= 10 ** 100 G = math.gcd(N, M) N //= G M //= G if M != 1: print(-1) else: ANS = "" for C in str(N): if C != "0": ANS = C print(ANS)