結果
問題 | No.754 畳み込みの和 |
ユーザー |
![]() |
提出日時 | 2018-12-02 11:44:50 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 28 ms / 5,000 ms |
コード長 | 486 bytes |
コンパイル時間 | 740 ms |
コンパイル使用メモリ | 73,176 KB |
最終ジャッジ日時 | 2025-01-06 17:54:51 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
ソースコード
#include<algorithm> #include<iostream> #include<vector> using namespace std; typedef long long lint; typedef vector<int>vi; typedef pair<int,int>pii; #define rep(i,n)for(int i=0;i<(int)(n);++i) const int N=110000; lint a[N],b[N]; const lint mo=1000000007; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n; cin>>n; rep(i,n+1)cin>>a[i]; rep(i,n+1)cin>>b[i]; rep(i,N-1)b[i+1]=(b[i]+b[i+1])%mo; lint c=0; rep(i,n+1)c=(c+a[i]*b[n-i])%mo; cout<<c<<endl; }