結果

問題 No.1274 楽しい格子点
ユーザー 👑 KazunKazun
提出日時 2020-10-30 23:12:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 588 bytes
コンパイル時間 706 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 71,840 KB
最終ジャッジ日時 2023-09-29 08:16:21
合計ジャッジ時間 7,059 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,260 KB
testcase_01 AC 80 ms
71,264 KB
testcase_02 AC 81 ms
71,184 KB
testcase_03 AC 80 ms
71,644 KB
testcase_04 AC 79 ms
71,836 KB
testcase_05 AC 80 ms
71,136 KB
testcase_06 AC 80 ms
71,840 KB
testcase_07 AC 80 ms
71,312 KB
testcase_08 AC 80 ms
71,488 KB
testcase_09 AC 78 ms
71,196 KB
testcase_10 AC 80 ms
71,488 KB
testcase_11 AC 79 ms
71,192 KB
testcase_12 AC 78 ms
71,532 KB
testcase_13 AC 80 ms
71,308 KB
testcase_14 AC 81 ms
71,664 KB
testcase_15 AC 78 ms
71,752 KB
testcase_16 AC 79 ms
71,344 KB
testcase_17 AC 79 ms
71,308 KB
testcase_18 AC 77 ms
71,804 KB
testcase_19 AC 78 ms
71,312 KB
testcase_20 AC 77 ms
71,452 KB
testcase_21 AC 77 ms
71,384 KB
testcase_22 AC 79 ms
71,388 KB
testcase_23 AC 78 ms
71,348 KB
testcase_24 AC 79 ms
71,456 KB
testcase_25 AC 82 ms
71,484 KB
testcase_26 AC 82 ms
71,524 KB
testcase_27 AC 76 ms
71,392 KB
testcase_28 AC 82 ms
71,272 KB
testcase_29 AC 79 ms
71,388 KB
testcase_30 AC 78 ms
71,680 KB
testcase_31 AC 81 ms
71,132 KB
testcase_32 AC 78 ms
71,420 KB
testcase_33 AC 80 ms
71,132 KB
testcase_34 AC 76 ms
71,484 KB
testcase_35 AC 81 ms
71,376 KB
testcase_36 AC 84 ms
71,388 KB
testcase_37 AC 78 ms
71,492 KB
testcase_38 AC 76 ms
71,580 KB
testcase_39 AC 82 ms
71,152 KB
testcase_40 AC 83 ms
71,464 KB
testcase_41 AC 82 ms
71,460 KB
testcase_42 AC 82 ms
71,624 KB
testcase_43 AC 77 ms
71,580 KB
testcase_44 AC 78 ms
71,380 KB
testcase_45 AC 78 ms
71,380 KB
testcase_46 AC 81 ms
71,492 KB
testcase_47 AC 82 ms
71,492 KB
testcase_48 AC 80 ms
71,840 KB
testcase_49 AC 79 ms
71,400 KB
testcase_50 AC 78 ms
71,596 KB
testcase_51 AC 83 ms
71,536 KB
testcase_52 AC 83 ms
71,476 KB
testcase_53 WA -
testcase_54 AC 83 ms
71,324 KB
testcase_55 WA -
testcase_56 AC 77 ms
71,392 KB
testcase_57 AC 76 ms
71,068 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.2912859971, 0.2539277432, 0.2503200596, 0.2500214336, \
0.2500012143, 0.2500000596, 0.2500000026, 0.2500000001][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