結果

問題 No.1274 楽しい格子点
ユーザー ygd.ygd.
提出日時 2020-10-30 23:15:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 714 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,440 KB
実行使用メモリ 77,216 KB
最終ジャッジ日時 2023-09-29 08:21:26
合計ジャッジ時間 8,383 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 109 ms
76,836 KB
testcase_02 WA -
testcase_03 AC 211 ms
76,860 KB
testcase_04 WA -
testcase_05 AC 99 ms
76,888 KB
testcase_06 WA -
testcase_07 AC 102 ms
76,844 KB
testcase_08 AC 76 ms
71,528 KB
testcase_09 AC 98 ms
77,112 KB
testcase_10 AC 100 ms
77,068 KB
testcase_11 WA -
testcase_12 AC 99 ms
77,084 KB
testcase_13 AC 103 ms
77,112 KB
testcase_14 WA -
testcase_15 AC 100 ms
77,072 KB
testcase_16 AC 100 ms
77,144 KB
testcase_17 AC 101 ms
76,884 KB
testcase_18 AC 101 ms
77,060 KB
testcase_19 AC 99 ms
77,112 KB
testcase_20 AC 98 ms
76,968 KB
testcase_21 AC 101 ms
76,844 KB
testcase_22 AC 74 ms
71,512 KB
testcase_23 AC 74 ms
71,348 KB
testcase_24 AC 74 ms
71,512 KB
testcase_25 AC 74 ms
71,832 KB
testcase_26 AC 75 ms
71,656 KB
testcase_27 AC 74 ms
71,424 KB
testcase_28 AC 74 ms
71,728 KB
testcase_29 AC 74 ms
71,520 KB
testcase_30 AC 74 ms
71,884 KB
testcase_31 AC 74 ms
71,500 KB
testcase_32 AC 75 ms
71,652 KB
testcase_33 AC 75 ms
71,512 KB
testcase_34 AC 76 ms
71,320 KB
testcase_35 AC 73 ms
71,796 KB
testcase_36 AC 75 ms
71,504 KB
testcase_37 AC 75 ms
71,504 KB
testcase_38 AC 75 ms
71,716 KB
testcase_39 AC 75 ms
71,508 KB
testcase_40 AC 75 ms
71,508 KB
testcase_41 AC 75 ms
71,452 KB
testcase_42 AC 144 ms
76,992 KB
testcase_43 AC 146 ms
76,848 KB
testcase_44 AC 212 ms
77,016 KB
testcase_45 AC 186 ms
77,020 KB
testcase_46 AC 185 ms
77,072 KB
testcase_47 AC 75 ms
71,360 KB
testcase_48 AC 211 ms
76,844 KB
testcase_49 AC 103 ms
77,088 KB
testcase_50 AC 185 ms
77,020 KB
testcase_51 AC 75 ms
71,560 KB
testcase_52 AC 76 ms
71,440 KB
testcase_53 AC 119 ms
77,016 KB
testcase_54 AC 167 ms
77,016 KB
testcase_55 AC 102 ms
77,012 KB
testcase_56 WA -
testcase_57 AC 76 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 = 100

ans = 0
if A == B:
  if A >= 10:
    MAX = 1
  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
if k >= 10:
  MAX = 1
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