結果

問題 No.2196 Pair Bonus
ユーザー hourenhouren
提出日時 2023-01-20 22:12:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 902 bytes
コンパイル時間 1,612 ms
コンパイル使用メモリ 168,200 KB
実行使用メモリ 7,812 KB
最終ジャッジ日時 2023-09-05 14:30:13
合計ジャッジ時間 3,354 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 75 ms
7,812 KB
testcase_04 AC 75 ms
7,740 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 14 ms
4,376 KB
testcase_09 AC 70 ms
7,472 KB
testcase_10 AC 46 ms
5,968 KB
testcase_11 AC 17 ms
4,380 KB
testcase_12 AC 60 ms
6,748 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 8 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 63 ms
7,612 KB
testcase_17 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define fix(x) fixed << setprecision(x)
#define asc(x) x, vector<x>, greater<x>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool chmax(T&a, const T&b){if(a<b){a=b;return 1;}return 0;}
constexpr ll INFLL = (1LL << 62);
constexpr int INF = (1 << 30);

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