結果
| 問題 |
No.754 畳み込みの和
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-02 07:59:20 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 521 bytes |
| コンパイル時間 | 729 ms |
| コンパイル使用メモリ | 76,044 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-28 02:30:30 |
| 合計ジャッジ時間 | 1,249 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 3 |
ソースコード
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
using i64 = int64_t;
constexpr int mod = static_cast<int>(powl(10, 9)) + 7;
int main(void) {
int n; scanf("%d", &n);
int N = n + 1;
vector<i64> a(N), b(N);
for(int i=0; i<N; ++i) { scanf("%ld", &a[i]); }
for(int i=0; i<N; ++i) { scanf("%ld", &b[i]); }
for(int i=0; i<N-1; ++i) { b[i+1] += b[i]; }
i64 res = 0;
for(int i=0; i<N; ++i) {
res += a[i] * b[N-1-i] % mod;
res %= mod;
}
printf("%ld\n", res);
return 0;
}