結果

問題 No.1318 ABCD quadruplets
ユーザー mkawa2mkawa2
提出日時 2020-12-16 16:24:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,394 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 11,956 KB
実行使用メモリ 17,296 KB
最終ジャッジ日時 2023-10-20 09:40:50
合計ジャッジ時間 5,367 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
14,508 KB
testcase_01 AC 28 ms
10,160 KB
testcase_02 AC 28 ms
10,160 KB
testcase_03 AC 28 ms
10,160 KB
testcase_04 AC 29 ms
10,160 KB
testcase_05 AC 29 ms
10,160 KB
testcase_06 AC 29 ms
10,160 KB
testcase_07 AC 28 ms
10,160 KB
testcase_08 AC 28 ms
10,160 KB
testcase_09 AC 29 ms
10,160 KB
testcase_10 AC 28 ms
10,164 KB
testcase_11 AC 29 ms
10,168 KB
testcase_12 AC 31 ms
10,160 KB
testcase_13 AC 827 ms
11,244 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def MI(): return map(int, sys.stdin.buffer.readline().split())
def MI1(): return map(int1, sys.stdin.buffer.readline().split())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
inf = 10**16
# md = 998244353
md = 10**9+7

n, m = MI()
ans = [0]*(n+1)
for a in range(m+1):
    s1 = a**2
    if s1 > n: break
    for b in range(a+1):
        s2 = s1+b*(a+b)
        ab = a == b
        if s2 > n: break
        for c in range(b+1):
            s3 = s2+c*(a+b+c)
            bc = b == c
            if s3 > n: break
            for d in range(c+1):
                s4 = s3+d*(a+b+c+d)
                cd = c == d
                if s4 > n: break
                abcd = ab+bc+cd
                if abcd == 0:   cur = 24
                elif abcd == 3: cur = 1
                elif abcd == 1: cur = 12
                elif ab and cd: cur = 6
                else:           cur = 4
                ans[s4] += cur
print(*ans, sep="\n")
0