結果

問題 No.1618 Convolution?
ユーザー 👑 rin204rin204
提出日時 2022-03-21 22:48:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 214 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 135,112 KB
最終ジャッジ日時 2024-04-17 19:42:06
合計ジャッジ時間 6,483 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,260 KB
testcase_01 AC 35 ms
51,968 KB
testcase_02 AC 157 ms
114,056 KB
testcase_03 AC 166 ms
122,840 KB
testcase_04 AC 147 ms
108,084 KB
testcase_05 AC 58 ms
73,472 KB
testcase_06 AC 176 ms
125,300 KB
testcase_07 AC 178 ms
125,584 KB
testcase_08 AC 150 ms
108,940 KB
testcase_09 AC 196 ms
133,520 KB
testcase_10 AC 157 ms
113,104 KB
testcase_11 AC 214 ms
135,048 KB
testcase_12 AC 201 ms
135,112 KB
testcase_13 AC 200 ms
133,932 KB
testcase_14 AC 200 ms
134,984 KB
testcase_15 AC 195 ms
134,020 KB
testcase_16 AC 197 ms
134,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = [0] * (2 * n + 1)
D = [0] * (2 * n + 1)
for i, (a, b) in enumerate(zip(A, B)):
    D[i + 1] += a
    D[i + n + 1] -= a
    C[i + n + 1] -= n * a
    D[i + 1] += b
    C[i + n + 1] -= n * b
    D[i + n + 1] -= b

for i in range(1, 2 * n):
    D[i] += D[i - 1]
    C[i] += C[i - 1] + D[i]

print(*C[:-1])
0