結果

問題 No.1274 楽しい格子点
ユーザー hotman78hotman78
提出日時 2020-09-24 22:53:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 551 bytes
コンパイル時間 1,684 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 93,060 KB
最終ジャッジ日時 2023-09-10 14:06:50
合計ジャッジ時間 27,600 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 RE -
testcase_02 RE -
testcase_03 WA -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 376 ms
92,016 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 WA -
testcase_23 AC 376 ms
92,016 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 374 ms
92,012 KB
testcase_29 WA -
testcase_30 AC 377 ms
91,784 KB
testcase_31 WA -
testcase_32 AC 374 ms
91,744 KB
testcase_33 AC 374 ms
91,740 KB
testcase_34 AC 372 ms
92,016 KB
testcase_35 AC 378 ms
92,012 KB
testcase_36 AC 380 ms
92,084 KB
testcase_37 AC 376 ms
92,012 KB
testcase_38 AC 379 ms
91,856 KB
testcase_39 WA -
testcase_40 AC 376 ms
91,952 KB
testcase_41 AC 380 ms
91,980 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
testcase_47 WA -
testcase_48 WA -
testcase_49 RE -
testcase_50 RE -
testcase_51 WA -
testcase_52 AC 219 ms
88,776 KB
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 RE -
testcase_57 AC 372 ms
92,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import Decimal
import decimal
import sys
import math
a,b=map(int,input().split())
decimal.getcontext().prec = 10000
if a==0 and b==0:
    print("0.25")
    sys.exit()
ans=Decimal(0)
for i in range(1,100):
    for j in range(1,100):
        k=math.gcd(a,b)
        if(a!=b and i%k==1 and j%k==1):
            if (i/k+j/k)%2==0 or (a/k+b/k)%2==1:
                ans+=Decimal(1)/Decimal((i+j)**(i+j))
        if a!=b and k==1:
            if (i/k+j/k)%2==0 or (a/k+b/k)%2==1:
                ans+=Decimal(1)/Decimal((i+j)**(i+j))
print(ans)
0