結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー mahiro72mahiro72
提出日時 2021-10-29 22:12:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 442 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 135,980 KB
最終ジャッジ日時 2024-04-16 15:01:08
合計ジャッジ時間 13,900 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,224 KB
testcase_01 AC 43 ms
52,608 KB
testcase_02 AC 44 ms
52,608 KB
testcase_03 AC 43 ms
52,480 KB
testcase_04 AC 43 ms
52,224 KB
testcase_05 AC 43 ms
52,224 KB
testcase_06 AC 43 ms
52,352 KB
testcase_07 AC 44 ms
52,864 KB
testcase_08 AC 43 ms
52,480 KB
testcase_09 AC 44 ms
52,352 KB
testcase_10 AC 43 ms
52,480 KB
testcase_11 AC 53 ms
60,928 KB
testcase_12 AC 45 ms
53,120 KB
testcase_13 AC 57 ms
61,696 KB
testcase_14 AC 59 ms
63,232 KB
testcase_15 AC 45 ms
52,864 KB
testcase_16 AC 177 ms
96,364 KB
testcase_17 AC 304 ms
134,252 KB
testcase_18 AC 324 ms
103,560 KB
testcase_19 AC 151 ms
93,184 KB
testcase_20 AC 151 ms
95,360 KB
testcase_21 AC 297 ms
135,592 KB
testcase_22 AC 416 ms
135,352 KB
testcase_23 AC 278 ms
135,184 KB
testcase_24 AC 395 ms
135,480 KB
testcase_25 AC 400 ms
135,600 KB
testcase_26 AC 291 ms
135,344 KB
testcase_27 AC 319 ms
135,216 KB
testcase_28 AC 404 ms
135,252 KB
testcase_29 AC 312 ms
135,348 KB
testcase_30 AC 297 ms
135,468 KB
testcase_31 AC 442 ms
135,216 KB
testcase_32 AC 355 ms
135,980 KB
testcase_33 AC 353 ms
135,728 KB
testcase_34 AC 365 ms
135,720 KB
testcase_35 AC 360 ms
135,864 KB
testcase_36 AC 43 ms
52,096 KB
testcase_37 AC 42 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
use = [True]*N
C = []

for i,(a,b) in enumerate(zip(A,B)):
    heapq.heappush(C,(-(b-a),i))

for i in range(N-K):
    value,index = heapq.heappop(C)
    use[index]=False

ans = ''.join(list(map(lambda x:'A'if x else 'B',use)))
print(ans)
0