結果
| 問題 |
No.754 畳み込みの和
|
| コンテスト | |
| ユーザー |
rickytheta
|
| 提出日時 | 2018-12-07 17:38:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 5,000 ms |
| コード長 | 747 bytes |
| コンパイル時間 | 1,294 ms |
| コンパイル使用メモリ | 157,316 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-14 03:25:26 |
| 合計ジャッジ時間 | 1,917 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:26:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
26 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
main.cpp:27:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
27 | REP(i,n+1)scanf("%lld",a+i);
| ~~~~~^~~~~~~~~~~~
main.cpp:28:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
28 | REP(i,n+1)scanf("%lld",b+i);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define FORR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define CHMIN(a,b) (a)=min((a),(b))
#define CHMAX(a,b) (a)=max((a),(b))
#define DEBUG(x) cout<<#x<<": "<<(x)<<endl
#define MOD 1000000007
int n;
ll a[125252], b[125252];
ll asum[125252];
int main(){
scanf("%d",&n);
REP(i,n+1)scanf("%lld",a+i);
REP(i,n+1)scanf("%lld",b+i);
REP(i,n+1)asum[i+1] = (asum[i]+a[i])%MOD;
ll ans = 0;
REP(i,n+1)(ans += b[i]*asum[n+1-i]%MOD) %= MOD;
printf("%lld\n",ans);
return 0;
}
rickytheta