結果

問題 No.1618 Convolution?
ユーザー KudeKude
提出日時 2021-07-22 21:48:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 244 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 1,556 ms
コンパイル使用メモリ 83,864 KB
実行使用メモリ 133,928 KB
最終ジャッジ日時 2023-09-24 16:26:30
合計ジャッジ時間 9,021 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,092 KB
testcase_01 AC 71 ms
71,192 KB
testcase_02 AC 201 ms
115,648 KB
testcase_03 AC 213 ms
126,392 KB
testcase_04 AC 191 ms
111,416 KB
testcase_05 AC 99 ms
78,556 KB
testcase_06 AC 217 ms
121,716 KB
testcase_07 AC 217 ms
121,952 KB
testcase_08 AC 192 ms
112,200 KB
testcase_09 AC 237 ms
133,044 KB
testcase_10 AC 197 ms
116,128 KB
testcase_11 AC 233 ms
131,084 KB
testcase_12 AC 235 ms
133,928 KB
testcase_13 AC 234 ms
132,564 KB
testcase_14 AC 235 ms
133,704 KB
testcase_15 AC 244 ms
133,220 KB
testcase_16 AC 242 ms
133,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input()) + 1
c = [0] * 2 * n
a1 = [0] + list(map(int, input().split()))
a2 = [0] + list(map(int, input().split()))
for a in a1, a2:
    s = 0
    acc = 0
    for i, x in enumerate(a):
        acc += s
        c[i] += acc
        s += x
    for i in range(n):
        acc += s
        acc -= n * a[i]
        s -= a[i]
        c[i + n] += acc
print(*c[1:-1])
0