結果

問題 No.754 畳み込みの和
ユーザー Siqing HouSiqing Hou
提出日時 2018-12-25 16:25:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 584 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 42,792 KB
最終ジャッジ日時 2024-04-08 22:32:49
合計ジャッジ時間 2,581 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def linelist(T=int):
    return [T(x) for x in input().split()]


def read(T=int):
    return T(input())


def ndarray(dims, v=0):
    if len(dims) == 1:
        return [v for _ in range(dims[0])]
    else:
        return [ndarray(dims[1:], v) for _ in range(dims[0])]

import numpy as np

modp = 10**9+8

n = read()
a = np.zeros(n+1, dtype=np.int)
b = np.zeros(n+1, dtype=np.int)
for i in range(n+1):
    a[i] = read()
for i in range(n+1):
    b[i] = read()

ans = 0
suma = 0
for i in range(n+1):
    suma += a[i]
    suma %= modp
    ans += suma * b[n-i]
    ans %= modp
print(ans)
0