結果
| 問題 | No.2196 Pair Bonus |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-02-15 18:59:49 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 2,000 ms |
| コード長 | 717 bytes |
| 記録 | |
| コンパイル時間 | 1,384 ms |
| コンパイル使用メモリ | 210,448 KB |
| 実行使用メモリ | 8,320 KB |
| 最終ジャッジ日時 | 2026-06-29 14:30:54 |
| 合計ジャッジ時間 | 3,672 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;
#define all(a) a.begin(),a.end()
#define pb push_back
#define sz(a) ((int)a.size())
const int maxn=200005;
int n;
ll a[maxn],b[maxn],c[maxn],d[maxn];
signed main(){
ios_base::sync_with_stdio(0),cin.tie(0);
cin >> n;
for(int i=0; i<n*2; ++i) cin >> a[i];
for(int i=0; i<n*2; ++i) cin >> b[i];
for(int i=0; i<n; ++i) cin >> c[i];
for(int i=0; i<n; ++i) cin >> d[i];
ll res=0;
for(int i=0; i<n; ++i){
ll maxx=-1;
for(int j1: {0,1}) for(int j2: {0,1}) maxx=max(maxx,(j1?b[i*2]:a[i*2])+(j2?b[i*2+1]:a[i*2+1])+(j1==j2?c[i]:d[i]));
res+=maxx;
}
cout << res << "\n";
}