結果

問題 No.1274 楽しい格子点
ユーザー 👑 Kazun
提出日時 2020-10-30 23:31:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 71,936 KB
最終ジャッジ日時 2024-07-22 18:39:54
合計ジャッジ時間 3,935 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 57
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
A,B=map(int,input().split())
if A==B==0:
    print(0.25)
else:
    g=math.gcd(A,B)
    X=0
    T=8*(g<=20)+2
    F=(A//g)%2*(B//g)%2+1
    for k in range(0,T):
        h=F*k*g+2
        X+=(F*k+1)/(h**h)
    print(X)
0