結果

問題 No.1274 楽しい格子点
ユーザー realDivineJKrealDivineJK
提出日時 2020-10-31 00:12:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,011 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 78,680 KB
最終ジャッジ日時 2023-09-29 09:19:03
合計ジャッジ時間 17,283 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 163 ms
77,096 KB
testcase_01 AC 172 ms
77,236 KB
testcase_02 WA -
testcase_03 AC 458 ms
77,860 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 449 ms
77,536 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 148 ms
76,824 KB
testcase_23 AC 150 ms
77,140 KB
testcase_24 AC 148 ms
77,224 KB
testcase_25 AC 149 ms
77,184 KB
testcase_26 AC 149 ms
77,172 KB
testcase_27 AC 163 ms
77,164 KB
testcase_28 AC 152 ms
77,156 KB
testcase_29 AC 149 ms
77,044 KB
testcase_30 AC 163 ms
77,080 KB
testcase_31 AC 151 ms
77,056 KB
testcase_32 AC 150 ms
77,188 KB
testcase_33 AC 150 ms
77,272 KB
testcase_34 AC 151 ms
77,080 KB
testcase_35 AC 153 ms
77,220 KB
testcase_36 AC 154 ms
76,972 KB
testcase_37 AC 149 ms
77,200 KB
testcase_38 AC 150 ms
77,168 KB
testcase_39 AC 149 ms
76,964 KB
testcase_40 AC 152 ms
77,200 KB
testcase_41 AC 150 ms
77,080 KB
testcase_42 AC 163 ms
76,924 KB
testcase_43 AC 164 ms
76,940 KB
testcase_44 AC 165 ms
77,072 KB
testcase_45 AC 163 ms
77,112 KB
testcase_46 AC 167 ms
77,220 KB
testcase_47 AC 163 ms
77,164 KB
testcase_48 AC 155 ms
77,172 KB
testcase_49 WA -
testcase_50 AC 164 ms
77,156 KB
testcase_51 AC 164 ms
77,136 KB
testcase_52 AC 70 ms
71,680 KB
testcase_53 AC 71 ms
71,292 KB
testcase_54 AC 69 ms
71,448 KB
testcase_55 AC 68 ms
71,484 KB
testcase_56 AC 165 ms
76,884 KB
testcase_57 AC 69 ms
71,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())
A = abs(A)
B = abs(B)
if A == 0 or B == 0:
    if A == 0 and B == 0:
        print(0.25)
    else:
        m = max(A, B)
        S = 1/4
        for i in range(10, 2, -1):
            if (i - 2) % m == 0:
                S += ((i - 2) // m + 1) / pow(i, i)
        print(S)
else:
    S = 0
    L = [[0 for _ in range(11)] for __ in range(11)]
    F = [0 for _ in range(11)]
    for i in range(-30, 30):
        for j in range(-30, 30):
            for k in range(-30, 30):
                for l in range(-30, 30):
                    if i % 2 == l % 2 and j % 2 == k % 2:
                        p = 1 + i * A + j * B
                        q = 1 + k * A + l * B
                        if 0 < p < 10 and 0 < q < 10 and 1 < p + q < 10:
                            L[p][q] = 1
    for i in range(10, 0, -1):
        for j in range(10, 0, -1):
            if i + j <= 10:
                F[i+j] += L[i][j]
    for i in range(10, 1, -1):
        S += F[i] / pow(i, i)
    print(S)
0