結果

問題 No.1274 楽しい格子点
ユーザー nagissnagiss
提出日時 2020-10-30 23:15:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 532 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 33,148 KB
最終ジャッジ日時 2023-09-29 08:22:24
合計ジャッジ時間 38,732 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 608 ms
30,420 KB
testcase_01 AC 524 ms
23,608 KB
testcase_02 WA -
testcase_03 AC 624 ms
32,928 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 654 ms
32,884 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 624 ms
31,960 KB
testcase_23 AC 628 ms
31,772 KB
testcase_24 AC 661 ms
31,672 KB
testcase_25 AC 650 ms
31,776 KB
testcase_26 AC 641 ms
31,684 KB
testcase_27 AC 627 ms
31,716 KB
testcase_28 AC 634 ms
31,844 KB
testcase_29 AC 632 ms
31,724 KB
testcase_30 AC 640 ms
31,704 KB
testcase_31 AC 627 ms
31,712 KB
testcase_32 AC 630 ms
31,664 KB
testcase_33 AC 626 ms
31,712 KB
testcase_34 AC 633 ms
31,684 KB
testcase_35 AC 635 ms
31,720 KB
testcase_36 AC 630 ms
31,868 KB
testcase_37 AC 645 ms
31,820 KB
testcase_38 AC 620 ms
31,664 KB
testcase_39 AC 640 ms
31,760 KB
testcase_40 AC 630 ms
31,688 KB
testcase_41 AC 630 ms
31,712 KB
testcase_42 AC 623 ms
30,352 KB
testcase_43 AC 630 ms
31,360 KB
testcase_44 AC 616 ms
30,672 KB
testcase_45 AC 602 ms
30,560 KB
testcase_46 AC 593 ms
30,008 KB
testcase_47 AC 609 ms
30,912 KB
testcase_48 AC 623 ms
31,424 KB
testcase_49 WA -
testcase_50 AC 634 ms
31,524 KB
testcase_51 AC 616 ms
31,552 KB
testcase_52 AC 19 ms
8,560 KB
testcase_53 AC 542 ms
23,648 KB
testcase_54 AC 543 ms
24,388 KB
testcase_55 AC 520 ms
21,872 KB
testcase_56 AC 505 ms
22,232 KB
testcase_57 AC 540 ms
25,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
A, B = map(int, input().split())
Closed = {(1, 1)}
ans = 0.25
Dx = [A,A,-A,-A,B,B,-B,-B]
Dy = [B,-B,B,-B,A,-A,A,-A]
q = deque([(1, 1)])
for i in range(10**5):
    if not q:
        break
    x, y = q.popleft()
    for dx, dy in zip(Dx, Dy):
        ux, uy = x+dx, y+dy
        if (ux, uy) not in Closed:
            Closed.add((ux, uy))
            q.append((ux, uy))
            if 1 <= ux < 20 and 1 <= uy < 20:
                ans += 1 / ((ux+uy)**(ux+uy))
                #print(ux, uy)
print(ans)
0