結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー 330Xs330Xs
提出日時 2022-02-05 13:53:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 517 ms / 2,000 ms
コード長 464 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 152,920 KB
最終ジャッジ日時 2023-09-02 06:36:15
合計ジャッジ時間 21,790 ms
ジャッジサーバーID
(参考情報)
judge13 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,816 KB
testcase_01 AC 89 ms
71,740 KB
testcase_02 AC 89 ms
71,368 KB
testcase_03 AC 90 ms
71,764 KB
testcase_04 AC 90 ms
71,896 KB
testcase_05 AC 93 ms
71,860 KB
testcase_06 AC 91 ms
71,788 KB
testcase_07 AC 90 ms
71,368 KB
testcase_08 AC 91 ms
71,664 KB
testcase_09 AC 91 ms
71,608 KB
testcase_10 AC 91 ms
71,872 KB
testcase_11 AC 97 ms
77,136 KB
testcase_12 AC 93 ms
71,700 KB
testcase_13 AC 97 ms
76,944 KB
testcase_14 AC 101 ms
76,908 KB
testcase_15 AC 92 ms
71,852 KB
testcase_16 AC 323 ms
108,824 KB
testcase_17 AC 484 ms
142,776 KB
testcase_18 AC 378 ms
131,608 KB
testcase_19 AC 212 ms
105,228 KB
testcase_20 AC 217 ms
107,836 KB
testcase_21 AC 501 ms
148,052 KB
testcase_22 AC 461 ms
134,688 KB
testcase_23 AC 513 ms
152,920 KB
testcase_24 AC 475 ms
135,312 KB
testcase_25 AC 471 ms
134,980 KB
testcase_26 AC 517 ms
147,512 KB
testcase_27 AC 512 ms
147,480 KB
testcase_28 AC 472 ms
134,900 KB
testcase_29 AC 502 ms
147,360 KB
testcase_30 AC 508 ms
150,308 KB
testcase_31 AC 423 ms
134,696 KB
testcase_32 AC 310 ms
138,944 KB
testcase_33 AC 313 ms
138,928 KB
testcase_34 AC 327 ms
139,668 KB
testcase_35 AC 329 ms
139,312 KB
testcase_36 AC 92 ms
71,796 KB
testcase_37 AC 91 ms
71,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

lis = []
for i in range(n):
    diff = a[i] - b[i]
    lis.append([a[i],b[i],diff,i])
lis2 = sorted(lis,key=lambda x:x[2])[::-1]
select_a = set()
for i in range(k):
    select_a.add(lis2[i][3])
    
ans = deque()
for i in range(n):
    if(i in select_a):
        ans.append('A')
    else:
        ans.append('B')
print(''.join(ans))
0