結果

問題 No.754 畳み込みの和
ユーザー tnakao0123
提出日時 2018-12-02 01:40:05
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 29 ms / 5,000 ms
コード長 963 bytes
コンパイル時間 782 ms
コンパイル使用メモリ 83,260 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 05:51:04
合計ジャッジ時間 1,379 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:46:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   46 |   scanf("%d", &n);
      |   ~~~~~^~~~~~~~~~
main.cpp:49:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   49 |     scanf("%d", as + i), asums[i + 1] = (asums[i] + as[i]) % MOD;
      |     ~~~~~^~~~~~~~~~~~~~
main.cpp:51:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   51 |     scanf("%d", bs + i);
      |     ~~~~~^~~~~~~~~~~~~~

ソースコード

diff #
プレゼンテーションモードにする

/* -*- coding: utf-8 -*-
*
* 754.cc: No.754 - yukicoder
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* constant */
const int MAX_N = 100000;
const int MOD = 1000000007;
/* typedef */
typedef long long ll;
/* global variables */
int as[MAX_N + 1], bs[MAX_N + 1], asums[MAX_N + 2];
/* subroutines */
/* main */
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i <= n; i++)
scanf("%d", as + i), asums[i + 1] = (asums[i] + as[i]) % MOD;
for (int i = 0; i <= n; i++)
scanf("%d", bs + i);
int c = 0;
for (int i = 0; i <= n; i++)
c = (c + (ll)asums[i + 1] * bs[n - i] % MOD) % MOD;
printf("%d\n", c);
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0