結果
| 問題 | No.754 畳み込みの和 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-02 10:02:24 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 56 ms / 5,000 ms |
| + 590µs | |
| コード長 | 449 bytes |
| 記録 | |
| コンパイル時間 | 364 ms |
| コンパイル使用メモリ | 76,904 KB |
| 実行使用メモリ | 9,716 KB |
| 最終ジャッジ日時 | 2026-10-15 09:55:48 |
| 合計ジャッジ時間 | 1,615 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
#include<iostream>
#include<numeric>
using namespace std;
typedef long long ll;
int main(){
int n;
cin >> n;
n++;
const ll mod = 1e9+7;
ll a[n], sum = 0;
for(int i = 0; i < n; i++) cin >> a[i], sum = (sum+a[i])%mod;
ll b, ans = 0;
for(int i = 0; i < n; i++){
cin >> b;
b %= mod;
ans = (ans+b*sum)%mod;
sum = (sum-a[n-1-i]+mod)%mod;
}
cout << ans << endl;
return 0;
}