結果

問題 No.1274 楽しい格子点
ユーザー 👑 KazunKazun
提出日時 2020-10-30 23:16:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,197 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 87,404 KB
実行使用メモリ 71,968 KB
最終ジャッジ日時 2023-09-29 08:22:38
合計ジャッジ時間 6,610 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,420 KB
testcase_01 AC 71 ms
71,968 KB
testcase_02 AC 68 ms
71,504 KB
testcase_03 AC 69 ms
71,676 KB
testcase_04 AC 72 ms
71,504 KB
testcase_05 AC 70 ms
71,880 KB
testcase_06 AC 70 ms
71,880 KB
testcase_07 AC 73 ms
71,524 KB
testcase_08 AC 71 ms
71,284 KB
testcase_09 AC 73 ms
71,840 KB
testcase_10 AC 73 ms
71,824 KB
testcase_11 AC 72 ms
71,492 KB
testcase_12 AC 71 ms
71,824 KB
testcase_13 AC 70 ms
71,408 KB
testcase_14 AC 71 ms
71,480 KB
testcase_15 AC 70 ms
71,500 KB
testcase_16 AC 71 ms
71,344 KB
testcase_17 AC 72 ms
71,480 KB
testcase_18 AC 71 ms
71,584 KB
testcase_19 AC 72 ms
71,660 KB
testcase_20 AC 74 ms
71,532 KB
testcase_21 AC 73 ms
71,276 KB
testcase_22 AC 72 ms
71,476 KB
testcase_23 AC 73 ms
71,656 KB
testcase_24 AC 73 ms
71,616 KB
testcase_25 AC 72 ms
71,692 KB
testcase_26 AC 72 ms
71,480 KB
testcase_27 AC 70 ms
71,412 KB
testcase_28 AC 70 ms
71,476 KB
testcase_29 AC 69 ms
71,284 KB
testcase_30 AC 71 ms
71,500 KB
testcase_31 AC 70 ms
71,476 KB
testcase_32 AC 71 ms
71,280 KB
testcase_33 AC 69 ms
71,488 KB
testcase_34 AC 70 ms
71,280 KB
testcase_35 AC 69 ms
71,484 KB
testcase_36 AC 69 ms
71,712 KB
testcase_37 AC 70 ms
71,288 KB
testcase_38 AC 69 ms
71,944 KB
testcase_39 AC 71 ms
71,720 KB
testcase_40 AC 72 ms
71,420 KB
testcase_41 AC 75 ms
71,496 KB
testcase_42 AC 70 ms
71,832 KB
testcase_43 AC 71 ms
71,836 KB
testcase_44 AC 74 ms
71,656 KB
testcase_45 AC 72 ms
71,580 KB
testcase_46 AC 69 ms
71,504 KB
testcase_47 AC 71 ms
71,476 KB
testcase_48 AC 71 ms
71,592 KB
testcase_49 AC 70 ms
71,476 KB
testcase_50 AC 71 ms
71,864 KB
testcase_51 AC 71 ms
71,424 KB
testcase_52 AC 70 ms
71,416 KB
testcase_53 WA -
testcase_54 AC 70 ms
71,416 KB
testcase_55 WA -
testcase_56 AC 69 ms
71,812 KB
testcase_57 AC 70 ms
71,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
A,B=map(int,input().split())

if A==B==0:
    print(0.25)
elif A==0 or B==0:
    C=max(abs(A),abs(B))
    if C>=9:
        print(0.25)
    else:
        print([0.291285997062663540407282590596, 0.253927743175264566674009102034,0.250320059608149804379393070974, 0.250021433570507634574389368789,
            0.250001214265791058668395963380, 0.250000059604644865383370307350,0.250000002581174791767407290614, 0.250000000100000000000025415281,
            0.250000000003504938994813934513, 0.250000000000112156654784615087,0.250000000000003301690955230119, 0.250000000000000089992745297813,
            0.250000000000000002283658260521, 0.250000000000000000054210108624,0.250000000000000000001208838648, 0.250000000000000000000025415281,
            0.250000000000000000000000505454, 0.250000000000000000000000009537,0.250000000000000000000000000171, 0.250000000000000000000000000003][C-1])
else:
    g=gcd(A,B)
    X=0

    if g<=20:
        T=10
    else:
        T=2

    if (A//g)%2==(B//g)%2==1:
        for k in range(T):
            h=2*k*g+2
            X+=(2*k+1)/(h**h)
    else:
        for k in range(T):
            h=k*g+2
            X+=(k+1)/(h**h)
    print(X)
0