結果
問題 | No.754 畳み込みの和 |
ユーザー |
|
提出日時 | 2018-12-16 21:46:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 81 ms / 5,000 ms |
コード長 | 507 bytes |
コンパイル時間 | 1,913 ms |
コンパイル使用メモリ | 168,276 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-25 06:37:01 |
合計ジャッジ時間 | 2,471 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define mod 1000000007int main() {int n; cin >> n;vector<long long> a(n+1, 0), b(n+1, 0);for (int i = 0; i <= n; ++i) {cin >> a[i];}for (int i = 0; i <= n; ++i) {cin >> b[i];if (i > 0) {b[i] += b[i-1]; b[i] %= mod;}}long long ans = 0;for (int i = 0; i <= n; ++i) {ans += (a[i] * b[n-i]) % mod;ans %= mod;}cout << ans << endl;return 0;}