結果
| 問題 |
No.1618 Convolution?
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2025-01-21 20:55:58 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 233 ms / 2,000 ms |
| コード長 | 342 bytes |
| コンパイル時間 | 186 ms |
| コンパイル使用メモリ | 82,232 KB |
| 実行使用メモリ | 163,632 KB |
| 最終ジャッジ日時 | 2025-01-21 20:56:08 |
| 合計ジャッジ時間 | 8,704 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 |
ソースコード
from itertools import accumulate
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(N):
B[i] += A[i]
B = [0] + B
A = list(accumulate(B))
tmp = 0
ans = []
for i in range(2 * N):
tmp += A[min(N, i)] - A[max(0, i - N)]
tmp -= N * B[max(0, i - N)]
ans.append(tmp)
print(*ans)
ntuda