結果
| 問題 | No.25 有限小数 |
| コンテスト | |
| ユーザー |
aaaaa
|
| 提出日時 | 2017-03-02 21:07:21 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 287 bytes |
| 記録 | |
| コンパイル時間 | 290 ms |
| コンパイル使用メモリ | 21,416 KB |
| 実行使用メモリ | 15,904 KB |
| 最終ジャッジ日時 | 2026-07-26 08:24:00 |
| 合計ジャッジ時間 | 5,157 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 7 |
ソースコード
import fractions
def F(n):
while n%2==0:n//=2
while n%5==0:n//=5
return n == 1
n,m=int(input()),int(input())
x=str(n/m)
if 'e' in x:x=x[:x.index('e')]
if F(fractions.Fraction(n,m).denominator):
for x in x[::-1]:
if x not in['0','.'] :print(x);break
else:print(-1)
aaaaa