結果

問題 No.1274 楽しい格子点
ユーザー ygd.ygd.
提出日時 2020-10-30 22:01:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 537 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 184,516 KB
最終ジャッジ日時 2023-09-29 06:07:31
合計ジャッジ時間 12,454 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 72 ms
71,644 KB
testcase_02 WA -
testcase_03 AC 73 ms
71,336 KB
testcase_04 WA -
testcase_05 AC 70 ms
71,444 KB
testcase_06 WA -
testcase_07 AC 74 ms
71,416 KB
testcase_08 AC 79 ms
71,676 KB
testcase_09 AC 71 ms
71,340 KB
testcase_10 AC 71 ms
71,388 KB
testcase_11 WA -
testcase_12 AC 72 ms
71,304 KB
testcase_13 AC 72 ms
71,348 KB
testcase_14 WA -
testcase_15 AC 70 ms
71,400 KB
testcase_16 AC 71 ms
71,440 KB
testcase_17 AC 72 ms
71,272 KB
testcase_18 AC 71 ms
71,392 KB
testcase_19 AC 75 ms
71,528 KB
testcase_20 AC 74 ms
71,300 KB
testcase_21 AC 73 ms
71,648 KB
testcase_22 AC 293 ms
72,648 KB
testcase_23 AC 976 ms
82,700 KB
testcase_24 AC 476 ms
75,096 KB
testcase_25 AC 254 ms
72,464 KB
testcase_26 AC 85 ms
71,376 KB
testcase_27 AC 86 ms
71,388 KB
testcase_28 AC 141 ms
71,676 KB
testcase_29 AC 84 ms
71,584 KB
testcase_30 AC 256 ms
72,504 KB
testcase_31 AC 72 ms
71,184 KB
testcase_32 AC 80 ms
71,336 KB
testcase_33 AC 140 ms
71,856 KB
testcase_34 AC 77 ms
71,400 KB
testcase_35 AC 99 ms
71,836 KB
testcase_36 AC 384 ms
73,508 KB
testcase_37 AC 80 ms
71,648 KB
testcase_38 AC 77 ms
71,344 KB
testcase_39 AC 104 ms
71,592 KB
testcase_40 AC 129 ms
71,928 KB
testcase_41 AC 99 ms
71,980 KB
testcase_42 AC 74 ms
71,408 KB
testcase_43 AC 70 ms
71,336 KB
testcase_44 AC 73 ms
71,396 KB
testcase_45 AC 71 ms
71,344 KB
testcase_46 AC 72 ms
71,444 KB
testcase_47 AC 70 ms
71,496 KB
testcase_48 AC 69 ms
71,376 KB
testcase_49 AC 70 ms
71,376 KB
testcase_50 AC 69 ms
71,140 KB
testcase_51 AC 72 ms
71,468 KB
testcase_52 WA -
testcase_53 AC 73 ms
71,592 KB
testcase_54 AC 72 ms
71,420 KB
testcase_55 AC 73 ms
71,676 KB
testcase_56 WA -
testcase_57 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
A,B = map(int,input().split())
MAX = 10
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)
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