結果
問題 | No.754 畳み込みの和 |
ユーザー |
![]() |
提出日時 | 2018-12-06 19:11:51 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 85 ms / 5,000 ms |
コード長 | 442 bytes |
コンパイル時間 | 416 ms |
コンパイル使用メモリ | 54,616 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 02:35:07 |
合計ジャッジ時間 | 1,236 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 |
ソースコード
#include <iostream>using namespace std;int main() {int n; cin >> n;long long a[n+1], b[n+1];for (int i = 0; i <= n; i++) cin >> a[i];for (int i = 0; i <= n; i++) cin >> b[i];long long s = 0, ans = 0;const long long M = 1000000007;for (int i = 0; i <= n; i++) {s += b[i];if (s >= M) s -= M;ans += a[n-i] * s % M;if (ans >= M) ans -= M;}cout << ans << endl;}