結果

問題 No.2196 Pair Bonus
ユーザー kokatsukokatsu
提出日時 2023-01-22 20:05:01
言語 D
(dmd 2.107.1)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 431 bytes
コンパイル時間 3,242 ms
コンパイル使用メモリ 204,316 KB
実行使用メモリ 19,428 KB
最終ジャッジ日時 2023-09-04 19:40:25
合計ジャッジ時間 5,800 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 114 ms
19,364 KB
testcase_04 AC 116 ms
19,376 KB
testcase_05 AC 2 ms
4,500 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 22 ms
8,860 KB
testcase_09 AC 110 ms
19,428 KB
testcase_10 AC 73 ms
15,492 KB
testcase_11 AC 27 ms
9,536 KB
testcase_12 AC 92 ms
18,340 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 12 ms
6,988 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 95 ms
19,076 KB
testcase_17 AC 4 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    long N;
    readf("%d\n", N);

    auto A = readln.chomp.split.to!(long[]);
    auto B = readln.chomp.split.to!(long[]);
    auto X = readln.chomp.split.to!(long[]);
    auto Y = readln.chomp.split.to!(long[]);

    long res;
    foreach (i; 0 .. N) {
        long p = i * 2, q = i * 2 + 1;
        res += max(A[p]+A[q]+X[i], A[p]+B[q]+Y[i], B[p]+A[q]+Y[i], B[p]+B[q]+X[i]);
    }

    res.writeln;
}
0