結果

問題 No.1274 楽しい格子点
ユーザー ygd.ygd.
提出日時 2020-10-30 22:13:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 711 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 71,716 KB
最終ジャッジ日時 2023-09-29 06:28:19
合計ジャッジ時間 6,069 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,688 KB
testcase_01 AC 68 ms
71,448 KB
testcase_02 WA -
testcase_03 AC 66 ms
71,568 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 67 ms
71,264 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 66 ms
71,448 KB
testcase_23 AC 67 ms
71,436 KB
testcase_24 AC 66 ms
71,436 KB
testcase_25 AC 67 ms
71,716 KB
testcase_26 AC 67 ms
71,444 KB
testcase_27 AC 66 ms
71,248 KB
testcase_28 AC 66 ms
71,428 KB
testcase_29 AC 67 ms
71,216 KB
testcase_30 AC 67 ms
71,380 KB
testcase_31 AC 69 ms
71,244 KB
testcase_32 AC 67 ms
71,712 KB
testcase_33 AC 67 ms
71,248 KB
testcase_34 AC 67 ms
71,428 KB
testcase_35 AC 66 ms
71,464 KB
testcase_36 AC 67 ms
71,444 KB
testcase_37 AC 66 ms
71,468 KB
testcase_38 AC 66 ms
71,340 KB
testcase_39 AC 66 ms
71,700 KB
testcase_40 AC 65 ms
71,564 KB
testcase_41 AC 65 ms
71,520 KB
testcase_42 AC 67 ms
71,696 KB
testcase_43 AC 68 ms
71,348 KB
testcase_44 AC 67 ms
71,248 KB
testcase_45 AC 67 ms
71,244 KB
testcase_46 AC 68 ms
71,468 KB
testcase_47 AC 66 ms
71,472 KB
testcase_48 AC 65 ms
71,468 KB
testcase_49 WA -
testcase_50 AC 66 ms
71,504 KB
testcase_51 AC 65 ms
71,356 KB
testcase_52 AC 66 ms
71,376 KB
testcase_53 AC 66 ms
71,564 KB
testcase_54 AC 66 ms
71,444 KB
testcase_55 AC 73 ms
71,632 KB
testcase_56 WA -
testcase_57 AC 66 ms
71,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
A,B = map(int,input().split())
A = abs(A); B = abs(B)
if A == 0 and B == 0:
  ans = 0.25; print(ans); exit()
MAX = 10
if A >= pow(10,4) or B >= pow(10,4):
  MAX = 1
ans = 0
if A == B:
  for y in range(MAX):
    for x in range(MAX):
      if y%2 == 0:
        kx = 1 + 2*A*x
        ky = 1 + A*y
      else:
        kx = 1 + 2*A*x + A
        ky = 1 + A*y
      temp = 1/pow(kx+ky,kx+ky)
      #print(x,y,kx,ky,temp)
      ans += temp
  print(ans);exit()
  
k = math.gcd(A,B)
#print(k) 片方ゼロならゼロではない数字がk
ans = 0
for y in range(MAX):
  for x in range(MAX):
    kx = 1 + k*x
    ky = 1 + k*y
    temp = 1/pow(kx+ky,kx+ky)
    #print(kx,ky,temp)
    ans += temp
print(ans)
0