結果

問題 No.1618 Convolution?
ユーザー 👑 tamatotamato
提出日時 2021-07-22 21:56:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 381 ms / 2,000 ms
コード長 614 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 87,712 KB
実行使用メモリ 148,120 KB
最終ジャッジ日時 2023-09-24 16:46:06
合計ジャッジ時間 8,262 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,608 KB
testcase_01 AC 69 ms
71,436 KB
testcase_02 AC 195 ms
127,708 KB
testcase_03 AC 210 ms
140,624 KB
testcase_04 AC 183 ms
121,168 KB
testcase_05 AC 91 ms
79,244 KB
testcase_06 AC 210 ms
132,828 KB
testcase_07 AC 209 ms
133,216 KB
testcase_08 AC 184 ms
121,580 KB
testcase_09 AC 239 ms
147,100 KB
testcase_10 AC 196 ms
127,212 KB
testcase_11 AC 239 ms
144,612 KB
testcase_12 AC 317 ms
148,120 KB
testcase_13 AC 240 ms
147,660 KB
testcase_14 AC 279 ms
147,656 KB
testcase_15 AC 381 ms
147,132 KB
testcase_16 AC 256 ms
148,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    AB = [a + b for a, b in zip(A, B)]

    C = [0] * (2*N)
    imos = [0] * (2*N+2)
    imos2 = [0] * (2*N+2)
    for i, ab in enumerate(AB):
        imos2[i+1] += ab
        imos2[i+1 + N] += -ab * (N+1)
        imos2[i+2 + N] += ab * N
    for i in range(1, 2*N+1):
        imos[i] = imos[i-1] + imos2[i]
    for i in range(1, 2*N):
        C[i] = C[i-1] + imos[i]
    print(*C)


if __name__ == '__main__':
    main()
0