結果

問題 No.1618 Convolution?
ユーザー nebukuro09nebukuro09
提出日時 2021-07-22 21:50:11
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 251 ms / 2,000 ms
コード長 642 bytes
コンパイル時間 1,991 ms
コンパイル使用メモリ 111,220 KB
実行使用メモリ 34,656 KB
最終ジャッジ日時 2023-09-04 13:25:45
合計ジャッジ時間 7,550 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 135 ms
22,000 KB
testcase_03 AC 161 ms
22,728 KB
testcase_04 AC 137 ms
19,400 KB
testcase_05 AC 12 ms
4,508 KB
testcase_06 AC 191 ms
23,684 KB
testcase_07 AC 192 ms
24,224 KB
testcase_08 AC 140 ms
20,116 KB
testcase_09 AC 251 ms
33,708 KB
testcase_10 AC 152 ms
23,512 KB
testcase_11 AC 218 ms
31,324 KB
testcase_12 AC 248 ms
33,424 KB
testcase_13 AC 249 ms
33,360 KB
testcase_14 AC 250 ms
34,060 KB
testcase_15 AC 249 ms
34,656 KB
testcase_16 AC 248 ms
33,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop;

void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.split.map!(to!long).array;
    auto B = readln.split.map!(to!long).array;

    long s = 0;
    long t = 0;
    long[] ans;
    foreach (i; 0..N) {
        ans ~= t;
        t += A[i] + B[i] + s;
        s += A[i] + B[i];
    }
    foreach (i; 0..N) {
        ans ~= t;
        t -= N*A[i] + N*B[i];
        s -= A[i] + B[i];
        t += s;
    }


    ans.map!(to!string).join(" ").writeln;
}
0