結果

問題 No.754 畳み込みの和
ユーザー chacoder1chacoder1
提出日時 2021-05-18 20:59:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 2,194 ms
コンパイル使用メモリ 194,000 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 08:08:22
合計ジャッジ時間 3,207 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
#define int long long
static const int mod=1000000007;

signed main(){
  int n;
  cin>>n;
  int a[n+2];
  int b[n+1];
  int sum=0;
  rep(i,n+1){
    cin>>a[i];
    sum+=a[i];
    sum%=mod;
  }
  a[n+1]=0;
  rep(i,n+1) cin>>b[i];  
  int ans=0;
  rep(i,n+1){   
    ans+=((b[i]*sum)%mod);
    ans%=mod;
    //cout<<b[i]*sum<<" "<<ans<<endl;
    sum-=a[n-i];

  }
  if(ans<0) ans+=mod;
  cout<<ans<<endl;
  return 0;
}
0