結果

問題 No.2196 Pair Bonus
ユーザー tsugutsugutsugutsugu
提出日時 2023-03-05 16:17:54
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 794 bytes
コンパイル時間 1,713 ms
コンパイル使用メモリ 169,732 KB
実行使用メモリ 7,904 KB
最終ジャッジ日時 2023-10-18 04:55:59
合計ジャッジ時間 3,319 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 69 ms
7,904 KB
testcase_04 AC 70 ms
7,904 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 13 ms
4,348 KB
testcase_09 AC 65 ms
7,640 KB
testcase_10 AC 42 ms
6,056 KB
testcase_11 AC 17 ms
4,348 KB
testcase_12 AC 55 ms
6,848 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 8 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 59 ms
7,640 KB
testcase_17 AC 3 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<long long> a(2 * n), b(2 * n), x(n), y(n);
    for (int i = 0; i < 2 * n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < 2 * n; i++) {
        cin >> b[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> x[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> y[i];
    }
    long long ans = 0;
    for (int i = 0; i < n; i++) {
        long long A = (a[2 * i] + a[2 * i + 1] + x[i]);
        long long B = (b[2 * i] + b[2 * i + 1] + x[i]);
        long long C = (a[2 * i] + b[2 * i + 1] + y[i]);
        long long D = (b[2 * i] + a[2 * i + 1] + y[i]);
        ans += max({A, B, C, D});
    }
    cout << ans << '\n';
}
0