結果

問題 No.2196 Pair Bonus
ユーザー norikamenorikame
提出日時 2023-01-21 02:13:21
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 247 ms / 2,000 ms
コード長 823 bytes
コンパイル時間 4,916 ms
コンパイル使用メモリ 306,872 KB
実行使用メモリ 19,812 KB
最終ジャッジ日時 2023-09-05 18:14:56
合計ジャッジ時間 7,815 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 244 ms
19,812 KB
testcase_04 AC 247 ms
19,360 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 AC 41 ms
5,764 KB
testcase_09 AC 227 ms
18,304 KB
testcase_10 AC 148 ms
12,896 KB
testcase_11 AC 53 ms
6,476 KB
testcase_12 AC 192 ms
15,936 KB
testcase_13 AC 3 ms
4,380 KB
testcase_14 AC 21 ms
4,412 KB
testcase_15 AC 4 ms
4,380 KB
testcase_16 AC 202 ms
18,284 KB
testcase_17 AC 5 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// 

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

using ll = long long;

#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i))
#define all(x) (x).begin(), (x).end()

const int INF = (int)(1e9);

int main() {
	int n;
	cin >> n;
	vector<vector<int>> ab(n*2, vector<int>(2)), xy(n, vector<int>(2));
	rep(i, n*2) cin >> ab[i][0];
	rep(i, n*2) cin >> ab[i][1];
	rep(i, n) cin >> xy[i][0];
	rep(i, n) cin >> xy[i][1];
	ll res = 0;
	rep(i, n) {
		ll mval = 0;
		rep(j1, 2) rep(j2, 2) mval = max(mval, (ll)ab[i*2][j1]+ab[i*2+1][j2]+xy[i][j1^j2]);
		res += mval;
	}
	cout << res << endl;
	return 0;
}
0