結果
| 問題 |
No.2196 Pair Bonus
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-01-20 22:17:14 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 195 ms / 2,000 ms |
| コード長 | 487 bytes |
| コンパイル時間 | 407 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 139,388 KB |
| 最終ジャッジ日時 | 2024-06-23 10:14:30 |
| 合計ジャッジ時間 | 3,345 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)