結果
問題 | No.1618 Convolution? |
ユーザー | publfl |
提出日時 | 2021-07-22 22:08:03 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 94 ms / 2,000 ms |
コード長 | 639 bytes |
コンパイル時間 | 327 ms |
コンパイル使用メモリ | 31,644 KB |
実行使用メモリ | 12,368 KB |
最終ジャッジ日時 | 2023-09-24 17:10:01 |
合計ジャッジ時間 | 5,583 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,924 KB |
testcase_01 | AC | 2 ms
4,920 KB |
testcase_02 | AC | 60 ms
11,080 KB |
testcase_03 | AC | 71 ms
11,924 KB |
testcase_04 | AC | 60 ms
10,156 KB |
testcase_05 | AC | 6 ms
5,360 KB |
testcase_06 | AC | 78 ms
11,392 KB |
testcase_07 | AC | 79 ms
11,328 KB |
testcase_08 | AC | 61 ms
10,268 KB |
testcase_09 | AC | 94 ms
12,352 KB |
testcase_10 | AC | 65 ms
10,356 KB |
testcase_11 | AC | 89 ms
12,068 KB |
testcase_12 | AC | 94 ms
12,292 KB |
testcase_13 | AC | 93 ms
12,336 KB |
testcase_14 | AC | 94 ms
12,292 KB |
testcase_15 | AC | 94 ms
12,368 KB |
testcase_16 | AC | 94 ms
12,292 KB |
ソースコード
#include <stdio.h> long long int x[200010],y[200010],x1[200010],y1[200010],x2[200010],y2[200010]; int main() { int a; scanf("%d",&a); for(int i=1;i<=a;i++) scanf("%lld",&x[i]); for(int i=1;i<=a;i++) x1[i] = x1[i-1] + x[i]; for(int i=1;i<=a;i++) x2[i] = x2[i-1] + i*x[i]; for(int i=1;i<=a;i++) scanf("%lld",&y[i]); for(int i=1;i<=a;i++) y1[i] = y1[i-1] + y[i]; for(int i=1;i<=a;i++) y2[i] = y2[i-1] + i*y[i]; for(int i=1;i<=2*a;i++) { int L = 1>i-a?1:i-a; int R = a<i-1?a:i-1; long long int s1 = i*(x1[R]-x1[L-1]) + i*(y1[R]-y1[L-1]); long long int s2 = (x2[R]-x2[L-1]) + (y2[R]-y2[L-1]); printf("%lld ",s1-s2); } }