結果

問題 No.1274 楽しい格子点
ユーザー ayaoniayaoni
提出日時 2020-10-31 00:40:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 481 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 71,708 KB
最終ジャッジ日時 2023-09-29 09:34:34
合計ジャッジ時間 7,185 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,564 KB
testcase_01 AC 72 ms
71,400 KB
testcase_02 AC 77 ms
71,292 KB
testcase_03 AC 79 ms
71,500 KB
testcase_04 AC 78 ms
71,424 KB
testcase_05 AC 78 ms
71,432 KB
testcase_06 AC 75 ms
71,292 KB
testcase_07 AC 75 ms
71,708 KB
testcase_08 AC 75 ms
71,228 KB
testcase_09 AC 78 ms
71,380 KB
testcase_10 AC 78 ms
71,324 KB
testcase_11 AC 76 ms
71,156 KB
testcase_12 AC 79 ms
71,636 KB
testcase_13 AC 79 ms
71,312 KB
testcase_14 AC 76 ms
71,380 KB
testcase_15 AC 75 ms
71,320 KB
testcase_16 AC 76 ms
71,584 KB
testcase_17 AC 75 ms
71,676 KB
testcase_18 AC 75 ms
71,272 KB
testcase_19 AC 77 ms
71,288 KB
testcase_20 AC 78 ms
71,428 KB
testcase_21 AC 75 ms
71,540 KB
testcase_22 AC 76 ms
71,464 KB
testcase_23 AC 79 ms
71,328 KB
testcase_24 AC 78 ms
71,704 KB
testcase_25 AC 75 ms
71,280 KB
testcase_26 AC 73 ms
71,464 KB
testcase_27 AC 76 ms
71,608 KB
testcase_28 AC 76 ms
71,296 KB
testcase_29 AC 77 ms
71,560 KB
testcase_30 AC 73 ms
71,100 KB
testcase_31 AC 74 ms
71,484 KB
testcase_32 AC 76 ms
71,312 KB
testcase_33 AC 76 ms
71,280 KB
testcase_34 AC 75 ms
71,648 KB
testcase_35 AC 75 ms
71,232 KB
testcase_36 AC 74 ms
71,332 KB
testcase_37 AC 73 ms
71,444 KB
testcase_38 AC 75 ms
71,092 KB
testcase_39 AC 76 ms
71,476 KB
testcase_40 AC 75 ms
71,300 KB
testcase_41 AC 73 ms
71,384 KB
testcase_42 AC 75 ms
71,488 KB
testcase_43 AC 76 ms
71,584 KB
testcase_44 AC 76 ms
71,408 KB
testcase_45 AC 76 ms
71,440 KB
testcase_46 AC 74 ms
71,332 KB
testcase_47 AC 79 ms
71,484 KB
testcase_48 AC 83 ms
71,428 KB
testcase_49 AC 76 ms
71,096 KB
testcase_50 AC 78 ms
71,320 KB
testcase_51 AC 76 ms
71,576 KB
testcase_52 WA -
testcase_53 AC 76 ms
71,524 KB
testcase_54 AC 77 ms
71,684 KB
testcase_55 AC 77 ms
71,284 KB
testcase_56 AC 79 ms
71,460 KB
testcase_57 AC 77 ms
71,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import gcd
def MI(): return map(int,sys.stdin.readline().rstrip().split())


A,B = MI()

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

g = gcd(A,B)
A //= g
B //= g

ans = 0
for i in range(20):
    if i % g != 0:
        continue
    x = i//g
    for j in range(20):
        if j % g != 0:
            continue
        y = j//g
        # (1+i,1+j)に辿り着けるか
        if (x-y) % 2 == 0 or (A*B) % 2 == 0:
            ans += 1/((2+i+j)**(2+i+j))

print(ans)
0