結果

問題 No.2196 Pair Bonus
ユーザー mushilymushily
提出日時 2023-03-16 10:30:31
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 835 bytes
コンパイル時間 509 ms
コンパイル使用メモリ 64,440 KB
実行使用メモリ 6,764 KB
最終ジャッジ日時 2023-10-18 12:56:21
合計ジャッジ時間 3,065 ms
ジャッジサーバーID
(参考情報)
judge15 / 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 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 3 ms
4,348 KB
testcase_07 AC 3 ms
4,348 KB
testcase_08 AC 41 ms
4,408 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 53 ms
4,640 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 5 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, q, h;

    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++)
    {
        q = i << 1;
        h = q + 1;
        t1 = a[q] + a[h] + x[i];
        t2 = a[q] + b[h] + y[i];
        if (t1 < t2)
            t1 = t2;
        t2 = b[q] + a[h] + y[i];
        if (t1 < t2)
            t1 = t2;
        t2 = b[q] + b[h] + x[i];
        if (t1 < t2)
            t1 = t2;
        s += t1;
    }
    cout << s << endl;
}
0