結果

問題 No.754 畳み込みの和
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-21 01:59:24
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 349 bytes
コンパイル時間 2,172 ms
コンパイル使用メモリ 193,660 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 04:30:01
合計ジャッジ時間 2,829 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int m=1e9+7;
    int n;cin>>n;
    int a[n+1];
    for (int i=0;i<=n;i++) cin>>a[i];
    ll ans=0;
    ll sum=0;
    for (int i=0;i<=n;i++) {
        int b;cin>>b;
        sum=(sum+b)%m;
        ans=(ans+a[n-i]*sum%m)%m;
    }
    cout<<ans<<endl;
    return 0;
}
0