結果

問題 No.3358 逆数の小数部分
コンテスト
ユーザー tkykwtnb
提出日時 2025-11-14 21:43:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 224 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 82,452 KB
実行使用メモリ 83,172 KB
最終ジャッジ日時 2025-11-14 21:43:12
合計ジャッジ時間 6,677 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import Decimal,getcontext
getcontext().prec=100
X=Decimal(input())
Y=set()
ans=0
while X not in Y and X>10**-50:
    Y.add(X)
    ans+=1
    X=pow(X,-1)
    X%=1
if X in Y:
    print("infy")
else:
    print(ans)
0