結果

問題 No.2196 Pair Bonus
ユーザー FplusFplusFFplusFplusF
提出日時 2023-01-20 21:42:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 228 ms / 2,000 ms
コード長 723 bytes
コンパイル時間 1,924 ms
コンパイル使用メモリ 201,008 KB
実行使用メモリ 8,072 KB
最終ジャッジ日時 2023-09-05 13:55:11
合計ジャッジ時間 4,339 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
using ll=long long;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll,ll>;
const ll INF=(1ll<<60);
template<class T> void chmin(T &a,T b){
    if(a>b){
        a=b;
    }
}
template<class T> void chmax(T &a,T b){
    if(a<b){
        a=b;
    }
}
int main(){
    ll n;
    cin >> n;
    vector<ll> a(2*n),b(2*n),x(n),y(n);
    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];
    ll ans=0;
    for(ll i=0;i<2*n-1;i+=2){
        ans+=max({a[i]+a[i+1]+x[i/2],b[i]+b[i+1]+x[i/2],a[i]+b[i+1]+y[i/2],b[i]+a[i+1]+y[i/2]});
    }
    cout << ans << endl;
}
0