結果
問題 | No.2196 Pair Bonus |
ユーザー |
![]() |
提出日時 | 2024-05-06 14:46:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 70 ms / 2,000 ms |
コード長 | 738 bytes |
コンパイル時間 | 2,034 ms |
コンパイル使用メモリ | 196,552 KB |
最終ジャッジ日時 | 2025-02-21 11:25:28 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 |
ソースコード
#include <bits/stdc++.h>using namespace std;void fast_io() {ios_base::sync_with_stdio(false);cin.tie(nullptr);}int main() {fast_io();int n;cin >> n;vector<long long> a(2 * n), b(2 * n), x(n), y(n);for (int i = 0; i < 2 * n; i++) {cin >> a[i];}for (int i = 0; i < 2 * n; i++) {cin >> b[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 < 2 * n; i += 2) {ans += max({a[i] + a[i + 1] + x[i / 2], b[i] + b[i + 1] + x[i / 2],a[i] + b[i + 1] + y[i / 2], b[i] + a[i + 1] + y[i / 2]});}cout << ans << endl;}