結果
| 問題 | No.25 有限小数 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-13 16:51:27 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 5,000 ms |
| + 246µs | |
| コード長 | 216 bytes |
| 記録 | |
| コンパイル時間 | 244 ms |
| コンパイル使用メモリ | 95,728 KB |
| 実行使用メモリ | 79,104 KB |
| 最終ジャッジ日時 | 2026-07-26 17:48:34 |
| 合計ジャッジ時間 | 4,096 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)