結果

問題 No.1618 Convolution?
ユーザー trineutrontrineutron
提出日時 2021-07-22 21:38:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 615 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 965 ms
コンパイル使用メモリ 10,888 KB
実行使用メモリ 55,284 KB
最終ジャッジ日時 2023-09-24 16:04:47
合計ジャッジ時間 12,577 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,832 KB
testcase_01 AC 15 ms
7,872 KB
testcase_02 AC 420 ms
34,116 KB
testcase_03 AC 515 ms
38,568 KB
testcase_04 AC 386 ms
37,380 KB
testcase_05 AC 45 ms
10,412 KB
testcase_06 AC 509 ms
45,956 KB
testcase_07 AC 517 ms
47,576 KB
testcase_08 AC 392 ms
38,260 KB
testcase_09 AC 605 ms
54,680 KB
testcase_10 AC 415 ms
39,480 KB
testcase_11 AC 580 ms
51,624 KB
testcase_12 AC 615 ms
53,256 KB
testcase_13 AC 613 ms
55,284 KB
testcase_14 AC 607 ms
53,212 KB
testcase_15 AC 609 ms
53,876 KB
testcase_16 AC 605 ms
53,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = []

sa = 0
sb = 0
ssa = 0
ssb = 0
for i in range(n):
    ans.append(ssa + ssb)
    sa += a[i]
    sb += b[i]
    ssa += sa
    ssb += sb

for i in range(n):
    ans.append(ssa + ssb)
    sa -= a[i]
    sb -= b[i]
    ssa += sa - n * a[i]
    ssb += sb - n * b[i]

print(*ans)
0