結果

問題 No.1724 [Cherry 3rd Tune A] Lápiz labial de Sonia
ユーザー 👑 箱星箱星
提出日時 2021-08-11 01:12:16
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 1,537 ms / 2,000 ms
コード長 896 bytes
コンパイル時間 16,444 ms
コンパイル使用メモリ 439,632 KB
実行使用メモリ 109,832 KB
最終ジャッジ日時 2024-04-16 13:33:39
合計ジャッジ時間 52,695 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 334 ms
52,424 KB
testcase_01 AC 330 ms
52,500 KB
testcase_02 AC 339 ms
52,596 KB
testcase_03 AC 338 ms
52,448 KB
testcase_04 AC 340 ms
52,392 KB
testcase_05 AC 337 ms
52,152 KB
testcase_06 AC 334 ms
52,320 KB
testcase_07 AC 346 ms
52,284 KB
testcase_08 AC 338 ms
52,512 KB
testcase_09 AC 341 ms
52,324 KB
testcase_10 AC 339 ms
52,304 KB
testcase_11 AC 354 ms
52,836 KB
testcase_12 AC 356 ms
52,584 KB
testcase_13 AC 353 ms
52,872 KB
testcase_14 AC 355 ms
52,880 KB
testcase_15 AC 347 ms
52,616 KB
testcase_16 AC 1,140 ms
95,932 KB
testcase_17 AC 1,444 ms
108,640 KB
testcase_18 AC 1,164 ms
103,256 KB
testcase_19 AC 816 ms
88,432 KB
testcase_20 AC 814 ms
88,600 KB
testcase_21 AC 1,463 ms
109,652 KB
testcase_22 AC 1,537 ms
109,268 KB
testcase_23 AC 1,411 ms
109,668 KB
testcase_24 AC 1,412 ms
109,428 KB
testcase_25 AC 1,385 ms
109,832 KB
testcase_26 AC 1,363 ms
109,584 KB
testcase_27 AC 1,360 ms
109,524 KB
testcase_28 AC 1,340 ms
109,276 KB
testcase_29 AC 1,413 ms
109,604 KB
testcase_30 AC 1,484 ms
109,824 KB
testcase_31 AC 1,380 ms
109,420 KB
testcase_32 AC 1,078 ms
93,864 KB
testcase_33 AC 1,072 ms
90,068 KB
testcase_34 AC 1,115 ms
93,972 KB
testcase_35 AC 1,126 ms
89,980 KB
testcase_36 AC 328 ms
52,084 KB
testcase_37 AC 340 ms
52,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter
import java.util.*
import kotlin.math.*

fun PrintWriter.solve() {
    val n = nextInt()
    val k = nextInt()
    val a = Array(n) { nextInt() }
    val b = Array(n) { nextInt() }
    val lst = (0 until n).sortedByDescending { a[it] - b[it] }.take(k)
    val choice = BooleanArray(n) { false }
    lst.forEach { choice[it] = true }
    println(choice.map { if (it) 'A' else 'B' }.joinToString(""))
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve()
    writer.flush()
}

// region Scanner
private var st = StringTokenizer("")
private val br = System.`in`.bufferedReader()

fun next(): String {
    while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())
    return st.nextToken()
}

fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextLine() = br.readLine()
fun nextDouble() = next().toDouble()
// endregion
0