結果

問題 No.1274 楽しい格子点
ユーザー hotman78hotman78
提出日時 2020-09-24 22:56:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 540 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 95,776 KB
最終ジャッジ日時 2023-09-10 14:07:52
合計ジャッジ時間 27,936 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 460 ms
94,516 KB
testcase_02 AC 811 ms
95,012 KB
testcase_03 WA -
testcase_04 AC 812 ms
95,132 KB
testcase_05 WA -
testcase_06 AC 812 ms
94,976 KB
testcase_07 WA -
testcase_08 AC 218 ms
89,384 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 806 ms
94,976 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 818 ms
94,760 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 218 ms
89,416 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 217 ms
89,500 KB
testcase_29 WA -
testcase_30 AC 216 ms
89,592 KB
testcase_31 WA -
testcase_32 AC 218 ms
89,448 KB
testcase_33 AC 218 ms
89,472 KB
testcase_34 AC 214 ms
89,516 KB
testcase_35 AC 215 ms
89,756 KB
testcase_36 AC 216 ms
89,628 KB
testcase_37 AC 221 ms
89,568 KB
testcase_38 AC 217 ms
89,520 KB
testcase_39 WA -
testcase_40 AC 215 ms
89,560 KB
testcase_41 AC 225 ms
89,604 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 239 ms
91,584 KB
testcase_45 AC 251 ms
91,452 KB
testcase_46 AC 246 ms
91,724 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 600 ms
95,768 KB
testcase_50 AC 250 ms
91,772 KB
testcase_51 WA -
testcase_52 AC 214 ms
88,904 KB
testcase_53 AC 362 ms
94,224 KB
testcase_54 AC 258 ms
91,760 KB
testcase_55 AC 1,214 ms
95,584 KB
testcase_56 AC 805 ms
95,776 KB
testcase_57 AC 215 ms
89,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import Decimal
import decimal
import sys
import math
a,b=map(int,input().split())
decimal.getcontext().prec = 400
if a==0 and b==0:
    print("0.25")
    sys.exit()
k=math.gcd(a,b)
ans=Decimal(0)
for i in range(1,100):
    for j in range(1,100):
        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