結果

問題 No.1274 楽しい格子点
ユーザー KudeKude
提出日時 2020-10-30 22:31:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 503 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 71,896 KB
最終ジャッジ日時 2023-09-29 07:12:21
合計ジャッジ時間 6,510 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 69 ms
71,436 KB
testcase_02 WA -
testcase_03 AC 67 ms
71,468 KB
testcase_04 WA -
testcase_05 AC 74 ms
71,428 KB
testcase_06 WA -
testcase_07 AC 70 ms
71,436 KB
testcase_08 AC 66 ms
71,280 KB
testcase_09 AC 75 ms
71,460 KB
testcase_10 AC 77 ms
71,472 KB
testcase_11 WA -
testcase_12 AC 73 ms
71,636 KB
testcase_13 AC 74 ms
71,628 KB
testcase_14 WA -
testcase_15 AC 74 ms
71,496 KB
testcase_16 AC 73 ms
71,788 KB
testcase_17 AC 73 ms
71,464 KB
testcase_18 AC 72 ms
71,344 KB
testcase_19 AC 74 ms
71,764 KB
testcase_20 AC 72 ms
71,436 KB
testcase_21 AC 71 ms
71,280 KB
testcase_22 WA -
testcase_23 AC 67 ms
71,448 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 71 ms
71,492 KB
testcase_29 WA -
testcase_30 AC 67 ms
71,468 KB
testcase_31 WA -
testcase_32 AC 68 ms
71,636 KB
testcase_33 AC 67 ms
71,232 KB
testcase_34 AC 67 ms
71,740 KB
testcase_35 AC 66 ms
71,544 KB
testcase_36 AC 71 ms
71,380 KB
testcase_37 AC 68 ms
71,236 KB
testcase_38 AC 67 ms
71,540 KB
testcase_39 WA -
testcase_40 AC 67 ms
71,500 KB
testcase_41 AC 66 ms
71,816 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 67 ms
71,496 KB
testcase_45 AC 69 ms
71,824 KB
testcase_46 AC 69 ms
71,632 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 70 ms
71,516 KB
testcase_50 AC 66 ms
71,412 KB
testcase_51 WA -
testcase_52 AC 66 ms
71,520 KB
testcase_53 AC 69 ms
71,432 KB
testcase_54 AC 68 ms
71,436 KB
testcase_55 AC 73 ms
71,896 KB
testcase_56 WA -
testcase_57 AC 74 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(abs, map(int, input().split()))
if a > b:
    a, b = b, a
if b == 0:
    print(0.25)
    exit(0)
from math import gcd
g = gcd(a, b)
ans = 0
if a // g % 2 == 1 and b // g % 2 == 1:
    for i in range(1000):
        xy = 2 + (2 * i + 1) * g
        if xy > 1000:
            break
        ans += (i + 1) / xy ** xy
    print('{0:.10f}'.format(ans))
    exit(0)
for i in range(1000):
    xy = 2 + i * g
    if xy > 1000:
        break
    ans += (i + 1) / xy ** xy
print('{0:.10f}'.format(ans))
0