結果

問題 No.1618 Convolution?
ユーザー nok0nok0
提出日時 2021-07-10 14:10:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 862 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 10,616 KB
実行使用メモリ 62,596 KB
最終ジャッジ日時 2023-09-24 15:07:01
合計ジャッジ時間 14,535 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,848 KB
testcase_01 AC 15 ms
7,788 KB
testcase_02 AC 559 ms
33,644 KB
testcase_03 AC 657 ms
38,740 KB
testcase_04 AC 501 ms
41,852 KB
testcase_05 AC 52 ms
10,720 KB
testcase_06 AC 661 ms
52,248 KB
testcase_07 AC 666 ms
51,860 KB
testcase_08 AC 530 ms
41,872 KB
testcase_09 AC 793 ms
59,136 KB
testcase_10 AC 547 ms
43,624 KB
testcase_11 AC 736 ms
57,324 KB
testcase_12 AC 815 ms
62,596 KB
testcase_13 AC 824 ms
61,016 KB
testcase_14 AC 829 ms
62,236 KB
testcase_15 AC 862 ms
59,608 KB
testcase_16 AC 798 ms
62,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
res = [0 for i in range(2 * n)]
for _ in range(2):
    a = list(map(int, input().split()))
    cum, add = 0, 0
    for i in range(2 * n - 1):
        if i < n:
            add += a[i]
        else:
            add -= a[i - n]
            cum -= a[i - n] * n
        cum += add
        res[i + 1] += cum
print(*res)
0