結果

問題 No.2196 Pair Bonus
ユーザー 沙耶花沙耶花
提出日時 2023-01-20 21:26:10
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 228 ms / 2,000 ms
コード長 590 bytes
コンパイル時間 4,012 ms
コンパイル使用メモリ 260,288 KB
実行使用メモリ 7,908 KB
最終ジャッジ日時 2023-09-05 13:34:19
合計ジャッジ時間 7,045 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 228 ms
7,908 KB
testcase_04 AC 227 ms
7,848 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 39 ms
4,380 KB
testcase_09 AC 211 ms
7,568 KB
testcase_10 AC 137 ms
6,044 KB
testcase_11 AC 50 ms
4,436 KB
testcase_12 AC 180 ms
6,728 KB
testcase_13 AC 3 ms
4,380 KB
testcase_14 AC 21 ms
4,380 KB
testcase_15 AC 4 ms
4,376 KB
testcase_16 AC 185 ms
7,588 KB
testcase_17 AC 4 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 4000000000000000001



int main(){
	
	int n;
	cin>>n;
	
	vector<long long> a(n*2),b(n*2),x(n),y(n);
	rep(i,n*2)cin>>a[i];
	rep(i,n*2)cin>>b[i];
	
	rep(i,n)cin>>x[i];
	rep(i,n)cin>>y[i];
	
	long long ans = 0;
	
	rep(i,n){
		int s = i*2,t = i*2+1;
		ans += max({a[s]+a[t]+x[i],a[s]+b[t]+y[i],a[t]+b[s]+y[i],b[s]+b[t]+x[i]});
	}
	
	cout<<ans<<endl;
	
	return 0;
}
0