結果
| 問題 |
No.754 畳み込みの和
|
| コンテスト | |
| ユーザー |
bal4u
|
| 提出日時 | 2019-05-13 22:37:00 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 648 bytes |
| コンパイル時間 | 1,128 ms |
| コンパイル使用メモリ | 29,312 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-08 09:31:01 |
| 合計ジャッジ時間 | 652 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 3 |
コンパイルメッセージ
main.c: In function 'in':
main.c:10:14: warning: implicit declaration of function 'getchar_unlocked' [-Wimplicit-function-declaration]
10 | #define gc() getchar_unlocked()
| ^~~~~~~~~~~~~~~~
main.c:16:24: note: in expansion of macro 'gc'
16 | int n = 0, c = gc();
| ^~
ソースコード
// yukicoder: 754 畳み込みの和
// 2019.5.13 bal4u
#include <stdio.h>
typedef long long ll;
#define M 1000000007
#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in() // 非負整数の入力
{
int n = 0, c = gc();
do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
return n;
}
int a[100005], b[10005], sb[10005];
int main()
{
int i, n, ans;
n = in();
for (i = 0; i <= n; i++) a[i] = in();
sb[0] = 0; for (i = 0; i <= n; i++) {
b[i] = in(), sb[i+1] = ((ll)sb[i] + b[i]) % M;
}
ans = 0; for (i = 0; i <= n; i++) {
ans = (ans + (ll)a[i]*sb[n-i+1]) % M;
}
printf("%d\n", ans);
return 0;
}
bal4u