結果

問題 No.2852 Yakitori Optimization Problem
ユーザー prd_xxxprd_xxx
提出日時 2024-08-25 13:35:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 402 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 81,968 KB
実行使用メモリ 138,108 KB
最終ジャッジ日時 2024-08-25 13:35:55
合計ジャッジ時間 6,396 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
92,960 KB
testcase_01 AC 278 ms
125,692 KB
testcase_02 AC 274 ms
126,948 KB
testcase_03 AC 366 ms
138,108 KB
testcase_04 AC 302 ms
124,344 KB
testcase_05 AC 146 ms
93,240 KB
testcase_06 AC 66 ms
75,680 KB
testcase_07 AC 299 ms
125,268 KB
testcase_08 AC 59 ms
73,924 KB
testcase_09 AC 359 ms
119,132 KB
testcase_10 AC 374 ms
133,964 KB
testcase_11 AC 374 ms
133,576 KB
testcase_12 AC 402 ms
133,564 KB
testcase_13 AC 373 ms
133,436 KB
testcase_14 AC 376 ms
133,552 KB
testcase_15 AC 377 ms
133,452 KB
testcase_16 AC 371 ms
133,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

order = list(range(N))
order.sort(key=lambda i: C[i]-B[i])

ans = 0
for i in range(K):
    ans += A[order[i]] + B[order[i]]
for i in range(K,N):
    ans += A[order[i]] + C[order[i]]
print(ans)
0