結果

問題 No.1274 楽しい格子点
ユーザー ygd.ygd.
提出日時 2020-10-30 22:04:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 594 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 87,292 KB
実行使用メモリ 185,516 KB
最終ジャッジ日時 2023-09-29 06:09:21
合計ジャッジ時間 9,951 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 71 ms
70,892 KB
testcase_02 WA -
testcase_03 AC 70 ms
70,852 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 71 ms
70,844 KB
testcase_08 AC 69 ms
71,008 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 69 ms
70,756 KB
testcase_16 AC 70 ms
70,764 KB
testcase_17 WA -
testcase_18 AC 71 ms
70,916 KB
testcase_19 AC 73 ms
71,016 KB
testcase_20 WA -
testcase_21 AC 70 ms
70,796 KB
testcase_22 AC 74 ms
71,088 KB
testcase_23 AC 80 ms
70,888 KB
testcase_24 AC 76 ms
70,968 KB
testcase_25 AC 73 ms
70,840 KB
testcase_26 AC 71 ms
70,796 KB
testcase_27 AC 86 ms
70,844 KB
testcase_28 AC 73 ms
71,084 KB
testcase_29 AC 74 ms
70,908 KB
testcase_30 AC 245 ms
71,972 KB
testcase_31 AC 71 ms
70,760 KB
testcase_32 AC 73 ms
71,080 KB
testcase_33 AC 73 ms
70,664 KB
testcase_34 AC 71 ms
70,844 KB
testcase_35 AC 73 ms
70,828 KB
testcase_36 AC 76 ms
70,996 KB
testcase_37 AC 73 ms
70,788 KB
testcase_38 AC 73 ms
70,840 KB
testcase_39 AC 69 ms
70,868 KB
testcase_40 AC 71 ms
70,892 KB
testcase_41 AC 72 ms
71,072 KB
testcase_42 AC 72 ms
71,080 KB
testcase_43 AC 73 ms
70,780 KB
testcase_44 AC 71 ms
70,832 KB
testcase_45 AC 71 ms
70,760 KB
testcase_46 AC 72 ms
70,860 KB
testcase_47 AC 71 ms
71,064 KB
testcase_48 AC 73 ms
70,868 KB
testcase_49 AC 73 ms
70,924 KB
testcase_50 AC 73 ms
70,976 KB
testcase_51 AC 74 ms
70,884 KB
testcase_52 WA -
testcase_53 AC 75 ms
70,852 KB
testcase_54 AC 72 ms
70,796 KB
testcase_55 AC 71 ms
70,756 KB
testcase_56 WA -
testcase_57 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
A,B = map(int,input().split())
MAX = 10
if A >= pow(10,9) or B >= pow(10,9):
  MAX = 3
ans = 0
if abs(A) == abs(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)
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