結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー 小野寺健小野寺健
提出日時 2021-10-30 13:12:21
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,441 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 49,408 KB
最終ジャッジ日時 2024-04-16 16:17:11
合計ジャッジ時間 31,925 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
12,160 KB
testcase_01 AC 87 ms
12,288 KB
testcase_02 AC 89 ms
12,032 KB
testcase_03 AC 91 ms
12,032 KB
testcase_04 AC 87 ms
12,160 KB
testcase_05 AC 88 ms
12,288 KB
testcase_06 AC 90 ms
12,160 KB
testcase_07 AC 87 ms
12,288 KB
testcase_08 AC 87 ms
12,160 KB
testcase_09 AC 86 ms
12,288 KB
testcase_10 AC 89 ms
12,288 KB
testcase_11 AC 94 ms
12,288 KB
testcase_12 AC 91 ms
12,288 KB
testcase_13 AC 91 ms
12,160 KB
testcase_14 AC 94 ms
12,288 KB
testcase_15 AC 91 ms
12,160 KB
testcase_16 AC 726 ms
32,128 KB
testcase_17 AC 1,276 ms
47,744 KB
testcase_18 AC 944 ms
35,072 KB
testcase_19 AC 432 ms
24,192 KB
testcase_20 AC 483 ms
24,192 KB
testcase_21 AC 1,412 ms
49,408 KB
testcase_22 AC 1,321 ms
45,568 KB
testcase_23 AC 1,441 ms
49,408 KB
testcase_24 AC 1,330 ms
47,232 KB
testcase_25 AC 1,332 ms
46,464 KB
testcase_26 AC 1,400 ms
49,280 KB
testcase_27 AC 1,409 ms
49,408 KB
testcase_28 AC 1,321 ms
46,976 KB
testcase_29 AC 1,410 ms
49,408 KB
testcase_30 AC 1,417 ms
49,280 KB
testcase_31 AC 1,291 ms
44,544 KB
testcase_32 AC 1,192 ms
48,512 KB
testcase_33 AC 1,200 ms
48,512 KB
testcase_34 AC 1,256 ms
48,640 KB
testcase_35 AC 1,242 ms
48,640 KB
testcase_36 AC 84 ms
12,160 KB
testcase_37 AC 85 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, K = gets.split(" ").map{|s| s.to_i}

a = gets.split(" ").map{|s| s.to_i}
b = gets.split(" ").map{|s| s.to_i}

d = a.zip(b).map.with_index{|x, i| [x[0]-x[1], i]}.sort.reverse

ans = ["B"]* N

d[0,K].each{|v, i|
	ans[i] = "A"
}

puts ans.join("")
0