結果

問題 No.1274 楽しい格子点
ユーザー cureskol
提出日時 2022-11-16 11:29:25
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 261 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-09-17 08:36:44
合計ジャッジ時間 3,567 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 50 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

A,B=map(int,input().split())

if A<0:A=-A
if B<0:B=-B
G=math.gcd(A,B)

if A==0 and B==0:
  print(0.25)
  exit(0)

ans=0
for n in range(10000):
  x=n+1
  y=2+n*G
  if y>1000000:break
  y=pow(y,y)
  ans+=x/y
  if x/y < 0.0000000001:break

print(ans)
0