結果
| 問題 | No.1618 Convolution? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-28 01:30:19 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 408 bytes |
| 記録 | |
| コンパイル時間 | 649 ms |
| コンパイル使用メモリ | 64,564 KB |
| 実行使用メモリ | 12,592 KB |
| 最終ジャッジ日時 | 2024-07-26 12:28:12 |
| 合計ジャッジ時間 | 10,394 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 15 |
コンパイルメッセージ
main.cpp:24:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
24 | main()
| ^~~~
ソースコード
#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;
}
}