結果

問題 No.2196 Pair Bonus
ユーザー Manuel1024Manuel1024
提出日時 2023-01-20 21:36:34
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 228 ms / 2,000 ms
コード長 675 bytes
コンパイル時間 757 ms
コンパイル使用メモリ 94,228 KB
実行使用メモリ 7,924 KB
最終ジャッジ日時 2023-09-05 13:47:44
合計ジャッジ時間 3,346 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 228 ms
7,924 KB
testcase_04 AC 228 ms
7,908 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 39 ms
4,376 KB
testcase_09 AC 211 ms
7,524 KB
testcase_10 AC 136 ms
5,932 KB
testcase_11 AC 50 ms
4,376 KB
testcase_12 AC 178 ms
6,720 KB
testcase_13 AC 3 ms
4,380 KB
testcase_14 AC 20 ms
4,380 KB
testcase_15 AC 3 ms
4,376 KB
testcase_16 AC 186 ms
7,640 KB
testcase_17 AC 5 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <deque>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
using ll = long long;
using ld = long double;

int main(){
    int n; cin >> n;
    vector<ll> a(n*2), b(n*2);
    for(auto &it: a) cin >> it;
    for(auto &it: b) cin >> it;
    vector<ll> x(n), y(n);
    for(auto &it: x) cin >> it;
    for(auto &it: y) cin >> it;

    ll ans = 0;
    for(int i = 0; i < n; i++){
        ans += max(max(a[i*2]+a[i*2+1], b[i*2]+b[i*2+1])+x[i],
        max(a[i*2]+b[i*2+1], b[i*2]+a[i*2+1])+y[i]);
    }
    cout << ans << endl;
    return 0;
}
0