結果

問題 No.1618 Convolution?
ユーザー kotatsugamekotatsugame
提出日時 2021-07-28 01:30:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 1,298 ms
コンパイル使用メモリ 64,088 KB
実行使用メモリ 11,596 KB
最終ジャッジ日時 2023-10-01 05:34:13
合計ジャッジ時間 12,597 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:24:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
   24 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int N;
long sA[4<<17],sB[4<<17];
int A[2<<17];
void f(long S[])
{
	S[0]=0;
	for(int i=1;i<2*N;i++)
	{
		S[i]=S[i-1];
		if(i<=N)
		{
			cin>>A[i];
			S[i]+=A[i];
		}
		else
		{
			S[i]-=(long)(N+1)*A[i-N];
			if(i>N+1)S[i]+=(long)N*A[i-N-1];
		}
	}
}
main()
{
	cin>>N;
	f(sA);
	f(sB);
	long ans=0;
	for(int i=1;i<=2*N;i++)
	{
		cout<<(ans+=sA[i-1]+sB[i-1])<<endl;
	}
}
0