結果

問題 No.1274 楽しい格子点
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2020-10-30 23:13:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 535 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 8,148 KB
最終ジャッジ日時 2023-09-29 08:20:10
合計ジャッジ時間 3,149 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,952 KB
testcase_01 AC 16 ms
7,968 KB
testcase_02 AC 16 ms
7,884 KB
testcase_03 AC 17 ms
7,936 KB
testcase_04 AC 16 ms
7,924 KB
testcase_05 AC 17 ms
7,968 KB
testcase_06 AC 17 ms
7,948 KB
testcase_07 AC 16 ms
7,948 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,940 KB
testcase_10 AC 17 ms
7,940 KB
testcase_11 AC 16 ms
8,000 KB
testcase_12 AC 17 ms
7,940 KB
testcase_13 AC 16 ms
7,924 KB
testcase_14 AC 17 ms
8,004 KB
testcase_15 AC 17 ms
7,956 KB
testcase_16 AC 17 ms
7,932 KB
testcase_17 AC 17 ms
7,920 KB
testcase_18 AC 17 ms
8,076 KB
testcase_19 AC 17 ms
7,936 KB
testcase_20 AC 17 ms
8,068 KB
testcase_21 AC 17 ms
7,976 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 16 ms
8,104 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 17 ms
7,940 KB
testcase_43 AC 17 ms
7,868 KB
testcase_44 AC 17 ms
7,956 KB
testcase_45 AC 17 ms
8,064 KB
testcase_46 AC 17 ms
7,976 KB
testcase_47 AC 17 ms
7,832 KB
testcase_48 AC 17 ms
7,968 KB
testcase_49 AC 17 ms
7,980 KB
testcase_50 AC 16 ms
7,884 KB
testcase_51 AC 16 ms
7,920 KB
testcase_52 AC 17 ms
7,856 KB
testcase_53 WA -
testcase_54 AC 17 ms
7,880 KB
testcase_55 WA -
testcase_56 AC 17 ms
8,072 KB
testcase_57 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd

A,B = map(int,input().split())

if A == 0 and B == 0:
    print(0.25)
elif A == 0 or B == 0:
    A = A + B
    A = abs(A)
    ans = 0
    for i in range(100//A):
        ans += 1/pow(i*A+2,i*A+2)
    print(ans)
else:
    A = abs(A)
    B = abs(B)
    g = gcd(A,B)
    ans = 0
    A //= g
    B //= g
    if (A & 1) == (B & 1) :
        for i in range(0,100//g,2):
            ans += 1.0/pow(i*g+2,i*g+2)*(i+1)
    else :
        for i in range(100//g):
            ans += 1.0/pow(i*g+2,i*g+2)*(i+1)
    print(ans)
0