結果

問題 No.1618 Convolution?
ユーザー m1k__m1k__
提出日時 2021-07-22 22:31:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 220 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 117,832 KB
最終ジャッジ日時 2023-09-24 17:47:54
合計ジャッジ時間 7,523 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,364 KB
testcase_01 AC 72 ms
71,292 KB
testcase_02 AC 178 ms
104,676 KB
testcase_03 AC 191 ms
109,804 KB
testcase_04 AC 173 ms
100,320 KB
testcase_05 AC 92 ms
77,456 KB
testcase_06 AC 206 ms
112,064 KB
testcase_07 AC 204 ms
112,060 KB
testcase_08 AC 175 ms
100,240 KB
testcase_09 AC 217 ms
116,328 KB
testcase_10 AC 185 ms
103,532 KB
testcase_11 AC 212 ms
114,832 KB
testcase_12 AC 218 ms
117,832 KB
testcase_13 AC 217 ms
116,996 KB
testcase_14 AC 219 ms
117,016 KB
testcase_15 AC 217 ms
116,540 KB
testcase_16 AC 220 ms
117,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
C = [0]*(2*N)
s = 0
for i in range(1, N+1):
    tmp = A[i-1]+B[i-1]
    C[i] = C[i-1]+tmp+s
    s += tmp
s = 0
for i in range(2*N-1, N, -1):
    tmp = A[i-N]+B[i-N]
    C[i] = N*tmp - s
    if i<2*N-1: C[i]+=C[i+1]
    s += tmp
print(*C)
0