結果
| 問題 | No.2196 Pair Bonus |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-01-20 22:17:14 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 125 ms / 2,000 ms |
| コード長 | 487 bytes |
| 記録 | |
| コンパイル時間 | 175 ms |
| コンパイル使用メモリ | 85,892 KB |
| 実行使用メモリ | 142,984 KB |
| 最終ジャッジ日時 | 2026-03-08 03:32:58 |
| 合計ジャッジ時間 | 1,934 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
score = 0
change = []
for i in range(n):
a1,a2 = A[2*i],A[2*i+1]
b1,b2 = B[2*i],B[2*i+1]
x,y = X[i],Y[i]
same = max(a1+a2,b1+b2)+x
dif = max(a1+b2,a2+b1)+y
score += same
change.append(dif-same)
ans = score
change.sort(reverse=True)
for c in change:
score += c
ans = max(ans,score)
print(ans)