結果

問題 No.2196 Pair Bonus
ユーザー Lim AloysiusLim Aloysius
提出日時 2023-01-20 21:53:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 1,277 bytes
コンパイル時間 2,087 ms
コンパイル使用メモリ 187,760 KB
実行使用メモリ 7,736 KB
最終ジャッジ日時 2023-09-05 14:09:38
合計ジャッジ時間 3,792 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#ifdef MY_LOCAL
#include "D://competitive_programming/debug/debug.h"
#define debug(x) cerr << "[" << #x<< "]:"<<x<<"\n"
#else
#define debug(x) 
#endif
#define REP(i, n) for(int i = 0; i < n; i ++)
#define REPL(i,m, n) for(int i = m; i < n; i ++)
#define SORT(arr) sort(arr.begin(), arr.end())
#define LSOne(S) ((S)&-(S))
#define M_PI 3.1415926535897932384
#define INF 1e18
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef double ld;
typedef tree<int,null_type,less<int>, rb_tree_tag, tree_order_statistics_node_update> ost;

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;cin>>n;
	vi arrA(2*n);
	vi arrB(2*n);
	vi arrX(n);
	vi arrY(n);
	REP(i, 2*n) {
		cin>>arrA[i];
	}
	REP(i, 2*n) {
		cin>>arrB[i];
	}
	REP(i, n) {
		cin>>arrX[i];
	}
	REP(i, n) {
		cin>>arrY[i];
	}
	int tot = 0;
	REP(i, n) {
		int bst = max(arrX[i] + max(arrA[2*i] + arrA[2*i+1], arrB[2*i]+arrB[2*i+1]),
			arrY[i] + max(arrA[2*i] + arrB[2*i+1], arrB[2*i]+arrA[2*i+1]));
		tot += bst;
	}
	cout<<tot<<"\n";
}
0