結果

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

ソースコード

diff #

import math;A,B=map(int,input().split())
if A==B==0:print(.25);exit()
g=math.gcd(A,B);X=0;T=8*(g<=9)+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