結果

問題 No.1618 Convolution?
ユーザー O2MTO2MT
提出日時 2021-07-23 18:14:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 275 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 86,740 KB
実行使用メモリ 169,000 KB
最終ジャッジ日時 2023-09-25 16:46:46
合計ジャッジ時間 10,474 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,280 KB
testcase_01 AC 70 ms
71,224 KB
testcase_02 AC 219 ms
152,040 KB
testcase_03 AC 239 ms
166,304 KB
testcase_04 AC 203 ms
140,352 KB
testcase_05 AC 92 ms
78,388 KB
testcase_06 AC 238 ms
153,676 KB
testcase_07 AC 233 ms
153,572 KB
testcase_08 AC 203 ms
141,060 KB
testcase_09 AC 275 ms
169,000 KB
testcase_10 AC 216 ms
146,832 KB
testcase_11 AC 260 ms
166,176 KB
testcase_12 AC 253 ms
151,844 KB
testcase_13 AC 252 ms
151,424 KB
testcase_14 AC 253 ms
151,696 KB
testcase_15 AC 257 ms
150,016 KB
testcase_16 AC 255 ms
151,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
AC = list(accumulate(A))
BC = list(accumulate(B))
C = [0]
for i in range(N):
  C.append(C[-1]+AC[i]+BC[i])

for i in range(N-1):
  if i > 0:
    C.append(C[-1]+AC[-1]+BC[-1]-(AC[i-1]+BC[i-1])-(N+1)*(A[i]+B[i]))
  else:
    C.append(C[-1]+AC[-1]+BC[-1]-(N+1)*(A[i]+B[i]))

print(*C)
0