結果
| 問題 |
No.754 畳み込みの和
|
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2020-04-02 15:58:23 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 613 bytes |
| コンパイル時間 | 1,644 ms |
| コンパイル使用メモリ | 168,524 KB |
| 実行使用メモリ | 10,112 KB |
| 最終ジャッジ日時 | 2024-06-28 15:06:22 |
| 合計ジャッジ時間 | 14,545 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define MOD (1000000000+7)
long long power( long long x, int n )
{
long long res = 1;
while( n > 0 ) {
if( n % 2 ) res = res * x % MOD;
x = x * x % MOD;
n /= 2;
}
return res;
}
int main()
{
int n;
cin >> n;
vector<long long> a( n + 1 );
for( int i = 0; i < n + 1; i++ ) {
cin >> a[i];
}
vector<long long> b( n + 1 );
for( int i = 0; i < n + 1; i++ ) {
cin >> b[i];
}
long long ans = 0;
for( int i = 0; i < n + 1; i++ ) {
for( int j = 0; j < i + 1; j++ ) {
ans += a[j] * b[i - j] % MOD;
ans %= MOD;
}
}
cout << ans << endl;
}
forest3