結果

問題 No.1274 楽しい格子点
ユーザー 👑 KazunKazun
提出日時 2020-10-30 23:06:22
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 557 bytes
コンパイル時間 830 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 78,884 KB
最終ジャッジ日時 2023-09-29 08:08:43
合計ジャッジ時間 10,137 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,296 KB
testcase_01 RE -
testcase_02 AC 76 ms
71,264 KB
testcase_03 RE -
testcase_04 AC 74 ms
71,480 KB
testcase_05 RE -
testcase_06 AC 76 ms
71,256 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 76 ms
71,260 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 74 ms
71,236 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 80 ms
71,300 KB
testcase_23 RE -
testcase_24 AC 74 ms
71,256 KB
testcase_25 AC 76 ms
71,372 KB
testcase_26 AC 76 ms
71,300 KB
testcase_27 AC 73 ms
70,820 KB
testcase_28 RE -
testcase_29 AC 74 ms
71,180 KB
testcase_30 RE -
testcase_31 AC 74 ms
71,148 KB
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 AC 74 ms
71,208 KB
testcase_40 RE -
testcase_41 RE -
testcase_42 AC 77 ms
71,244 KB
testcase_43 AC 76 ms
71,324 KB
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
testcase_47 AC 77 ms
71,068 KB
testcase_48 AC 76 ms
71,072 KB
testcase_49 RE -
testcase_50 RE -
testcase_51 AC 76 ms
71,248 KB
testcase_52 AC 77 ms
71,256 KB
testcase_53 WA -
testcase_54 AC 76 ms
71,228 KB
testcase_55 WA -
testcase_56 AC 77 ms
71,180 KB
testcase_57 AC 125 ms
72,916 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))
    X=0

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

    for k in range(T):
        h=(k*C+2)
        X+=1/(h**h)
    print(X)
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:
        X=1/0
        for k in range(T):
            h=k*g+2
            X+=(k+1)/(h**h)
    print(X)
0