結果

問題 No.754 畳み込みの和
コンテスト
ユーザー Siqing Hou
提出日時 2018-12-25 16:37:03
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 568 ms / 5,000 ms
+ 858µs
コード長 449 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 55 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 34,448 KB
最終ジャッジ日時 2026-09-07 13:24:41
合計ジャッジ時間 3,312 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import numpy as np


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


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



modp = 10 ** 9 + 7

n = read()
a = np.zeros(n + 1, dtype=np.longlong)
b = np.zeros(n + 1, dtype=np.longlong)
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