結果

問題 No.2196 Pair Bonus
ユーザー mushilymushily
提出日時 2023-03-16 10:18:51
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 854 bytes
コンパイル時間 520 ms
コンパイル使用メモリ 64,616 KB
実行使用メモリ 6,792 KB
最終ジャッジ日時 2023-10-18 12:56:02
合計ジャッジ時間 3,476 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 WA -
testcase_04 WA -
testcase_05 AC 3 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 3 ms
4,348 KB
testcase_08 AC 40 ms
4,428 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 53 ms
4,660 KB
testcase_12 WA -
testcase_13 AC 3 ms
4,348 KB
testcase_14 AC 21 ms
4,348 KB
testcase_15 AC 4 ms
4,348 KB
testcase_16 WA -
testcase_17 AC 4 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
int main()
{
    long long s = 0, t1, t2;
    long a[100000];
    long b[100000];
    long x[100000];
    long y[100000];
    int n, i;

    cin >> n;
    for (i = 0; i < (n << 1); i++)
    {
        cin >> a[i];
    }
    for (i = 0; i < (n << 1); i++)
    {
        cin >> b[i];
    }
    for (i = 0; i < n; i++)
    {
        cin >> x[i];
    }
    for (i = 0; i < n; i++)
    {
        cin >> y[i];
    }
    for (i = 0; i < n; i++)
    {
        t1 = a[i << 1] + a[(i << 1) + 1] + x[i];
        t2 = a[i << 1] + b[(i << 1) + 1] + y[i];
        if (t1 < t2)
            t1 = t2;
        t2 = b[i << 1] + a[(i << 1) + 1] + y[i];
        if (t1 < t2)
            t1 = t2;
        t2 = b[i << 1] + b[(i << 1) + 1] + x[i];
        if (t1 < t2)
            t1 = t2;
        s += t1;
    }
    cout << s << endl;
}
0