結果
| 問題 |
No.2196 Pair Bonus
|
| コンテスト | |
| ユーザー |
nono00
|
| 提出日時 | 2023-01-20 22:04:01 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 249 ms / 2,000 ms |
| コード長 | 828 bytes |
| コンパイル時間 | 1,727 ms |
| コンパイル使用メモリ | 197,464 KB |
| 最終ジャッジ日時 | 2025-02-10 04:51:49 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
vector<vector<long long>> ab(2, vector<long long>(2 * n));
vector<long long> x(n), y(n);
for (int i = 0; i < 2 * n; i++) cin >> ab[0][i];
for (int i = 0; i < 2 * n; i++) cin >> ab[1][i];
for (int i = 0; i < n; i++) cin >> x[i];
for (int i = 0; i < n; i++) cin >> y[i];
long long ans = 0;
for (int i = 0; i < n; i++) {
int l = 2 * i, r = 2 * i + 1;
long long now = 0;
for (int j = 0; j < 2; j++) {
for (int k = 0; k < 2; k++) {
now = max(now, ab[j][l] + ab[k][r] + (j == k ? x[i] : y[i]));
}
}
ans += now;
}
cout << ans << '\n';
}
int main() {
int q = 1;
// cin >> q;
while (q--) {
solve();
}
}
nono00