結果

問題 No.754 畳み込みの和
ユーザー matsu7874matsu7874
提出日時 2018-12-02 00:10:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 405 ms / 5,000 ms
コード長 237 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 16,040 KB
最終ジャッジ日時 2023-09-09 09:43:58
合計ジャッジ時間 2,489 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 397 ms
16,040 KB
testcase_01 AC 405 ms
16,040 KB
testcase_02 AC 399 ms
16,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

a = [int(input()) for i in range(n+1)]
b = [int(input()) for i in range(n+1)]

mod = 10**9+7
total = 0

a_sum = sum(a)
for i in range(n, -1, -1):
    total = (total + a_sum*b[n-i]) % mod
    a_sum -= a[i]

print(total)
0