結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー face4face4
提出日時 2021-04-10 18:09:14
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 581 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 13,064 ms
コンパイル使用メモリ 424,120 KB
実行使用メモリ 65,364 KB
最終ジャッジ日時 2023-09-08 13:54:53
合計ジャッジ時間 21,352 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 319 ms
57,020 KB
testcase_01 AC 311 ms
56,868 KB
testcase_02 AC 288 ms
53,044 KB
testcase_03 AC 289 ms
52,988 KB
testcase_04 AC 581 ms
63,660 KB
testcase_05 AC 310 ms
57,004 KB
testcase_06 AC 314 ms
57,092 KB
testcase_07 AC 528 ms
65,364 KB
testcase_08 AC 513 ms
65,236 KB
testcase_09 AC 517 ms
65,208 KB
testcase_10 AC 290 ms
52,888 KB
testcase_11 AC 291 ms
53,460 KB
testcase_12 AC 307 ms
58,964 KB
testcase_13 AC 308 ms
57,020 KB
testcase_14 AC 321 ms
57,152 KB
testcase_15 AC 314 ms
57,236 KB
testcase_16 AC 331 ms
57,136 KB
testcase_17 AC 292 ms
53,464 KB
testcase_18 AC 306 ms
57,100 KB
testcase_19 AC 319 ms
56,884 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:2:10: warning: variable 'n' is never used
    val (n, m, x, y) = readLine()!!.split(" ").map { it.toInt() }
         ^

ソースコード

diff #

fun main() {
    val (n, m, x, y) = readLine()!!.split(" ").map { it.toInt() }
    val a = readLine()!!.split(" ").map { it.toLong() }
    a.filter { it > y }.sorted().reversed().apply {
        dropLast(0.coerceAtLeast(this.size - (m + 1))).let {
            if(it.isEmpty()){
                println(0)
            }else if (it.size == m+1 && it.last() >= x) {
                println("Handicapped")
            } else {
                println(it.dropLast(if(it.size==m+1) 1 else 0).sum())
            }
        }
    }
}
0