結果

問題 No.1318 ABCD quadruplets
ユーザー H3PO4H3PO4
提出日時 2022-10-09 09:10:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,433 ms / 2,000 ms
コード長 742 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 86,784 KB
実行使用メモリ 85,684 KB
最終ジャッジ日時 2023-09-05 12:59:28
合計ジャッジ時間 14,314 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,440 KB
testcase_01 AC 73 ms
71,384 KB
testcase_02 AC 71 ms
71,188 KB
testcase_03 AC 73 ms
71,368 KB
testcase_04 AC 73 ms
71,064 KB
testcase_05 AC 73 ms
71,048 KB
testcase_06 AC 74 ms
71,388 KB
testcase_07 AC 73 ms
71,368 KB
testcase_08 AC 73 ms
71,268 KB
testcase_09 AC 74 ms
71,228 KB
testcase_10 AC 74 ms
71,064 KB
testcase_11 AC 72 ms
71,228 KB
testcase_12 AC 73 ms
71,348 KB
testcase_13 AC 143 ms
78,448 KB
testcase_14 AC 570 ms
83,848 KB
testcase_15 AC 117 ms
77,504 KB
testcase_16 AC 716 ms
83,504 KB
testcase_17 AC 134 ms
80,756 KB
testcase_18 AC 518 ms
83,240 KB
testcase_19 AC 238 ms
83,864 KB
testcase_20 AC 138 ms
77,704 KB
testcase_21 AC 195 ms
79,168 KB
testcase_22 AC 127 ms
82,152 KB
testcase_23 AC 1,392 ms
85,592 KB
testcase_24 AC 1,224 ms
85,276 KB
testcase_25 AC 325 ms
84,888 KB
testcase_26 AC 206 ms
83,900 KB
testcase_27 AC 860 ms
85,464 KB
testcase_28 AC 366 ms
84,760 KB
testcase_29 AC 440 ms
84,820 KB
testcase_30 AC 1,427 ms
85,012 KB
testcase_31 AC 339 ms
85,032 KB
testcase_32 AC 1,433 ms
85,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())

res = [0] * (N + 1)
for a in range(M + 1):
    a_ = a ** 2
    for b in range(a, M + 1):
        b_ = b * (a + b)
        for c in range(b, M + 1):
            c_ = c * (a + b + c)
            for d in range(c, M + 1):
                x = a_ + b_ + c_ + d * (a + b + c + d)
                if x > N:
                    break
                if a == b == c == d:
                    res[x] += 1
                elif a == b == c or b == c == d:
                    res[x] += 4
                elif a == b and c == d:
                    res[x] += 6
                elif a == b or b == c or c == d:
                    res[x] += 12
                else:
                    res[x] += 24

print(*res, sep="\n")
0