結果
問題 | No.2856 Junk Market Game |
ユーザー | Basin-Bug |
提出日時 | 2024-08-25 23:08:19 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 64 ms / 2,000 ms |
コード長 | 301 bytes |
コンパイル時間 | 480 ms |
コンパイル使用メモリ | 82,796 KB |
実行使用メモリ | 63,192 KB |
最終ジャッジ日時 | 2024-08-25 23:08:24 |
合計ジャッジ時間 | 4,953 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 41 ms
53,412 KB |
testcase_01 | AC | 39 ms
53,320 KB |
testcase_02 | AC | 39 ms
52,612 KB |
testcase_03 | AC | 42 ms
52,068 KB |
testcase_04 | AC | 42 ms
51,944 KB |
testcase_05 | AC | 42 ms
51,940 KB |
testcase_06 | AC | 39 ms
53,036 KB |
testcase_07 | AC | 41 ms
52,836 KB |
testcase_08 | AC | 39 ms
53,420 KB |
testcase_09 | AC | 39 ms
52,464 KB |
testcase_10 | AC | 44 ms
59,336 KB |
testcase_11 | AC | 51 ms
62,876 KB |
testcase_12 | AC | 50 ms
61,588 KB |
testcase_13 | AC | 44 ms
58,284 KB |
testcase_14 | AC | 49 ms
61,928 KB |
testcase_15 | AC | 43 ms
59,396 KB |
testcase_16 | AC | 49 ms
61,948 KB |
testcase_17 | AC | 48 ms
61,928 KB |
testcase_18 | AC | 49 ms
61,360 KB |
testcase_19 | AC | 48 ms
61,048 KB |
testcase_20 | AC | 44 ms
59,316 KB |
testcase_21 | AC | 48 ms
61,308 KB |
testcase_22 | AC | 49 ms
62,436 KB |
testcase_23 | AC | 48 ms
61,088 KB |
testcase_24 | AC | 51 ms
61,464 KB |
testcase_25 | AC | 44 ms
58,480 KB |
testcase_26 | AC | 39 ms
53,008 KB |
testcase_27 | AC | 53 ms
62,608 KB |
testcase_28 | AC | 51 ms
61,492 KB |
testcase_29 | AC | 49 ms
61,808 KB |
testcase_30 | AC | 50 ms
63,192 KB |
testcase_31 | AC | 48 ms
62,484 KB |
testcase_32 | AC | 50 ms
61,520 KB |
testcase_33 | AC | 51 ms
63,072 KB |
testcase_34 | AC | 51 ms
61,612 KB |
testcase_35 | AC | 49 ms
62,652 KB |
testcase_36 | AC | 49 ms
62,284 KB |
testcase_37 | AC | 50 ms
62,056 KB |
testcase_38 | AC | 50 ms
62,208 KB |
testcase_39 | AC | 49 ms
62,592 KB |
testcase_40 | AC | 50 ms
61,564 KB |
testcase_41 | AC | 50 ms
62,648 KB |
testcase_42 | AC | 49 ms
62,868 KB |
testcase_43 | AC | 64 ms
61,584 KB |
testcase_44 | AC | 49 ms
62,128 KB |
testcase_45 | AC | 51 ms
61,460 KB |
testcase_46 | AC | 50 ms
62,804 KB |
testcase_47 | AC | 50 ms
62,180 KB |
testcase_48 | AC | 50 ms
62,000 KB |
testcase_49 | AC | 50 ms
61,448 KB |
testcase_50 | AC | 50 ms
62,344 KB |
testcase_51 | AC | 49 ms
62,096 KB |
ソースコード
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = [(A[i], B[i], A[i] + B[i]) for i in range(2 * N)] C.sort(key = lambda x: x[-1]) ans1 = 0 ans2 = 0 for i in range(2 * N): if i % 2 == 0: ans1 += C[i][0] else: ans2 += C[i][1] print(ans1 - ans2)