結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー face4face4
提出日時 2021-04-10 18:07:39
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 15,977 ms
コンパイル使用メモリ 422,956 KB
実行使用メモリ 65,424 KB
最終ジャッジ日時 2023-09-08 13:52:48
合計ジャッジ時間 23,836 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 314 ms
57,032 KB
testcase_01 AC 315 ms
57,144 KB
testcase_02 AC 302 ms
53,136 KB
testcase_03 AC 301 ms
52,968 KB
testcase_04 AC 592 ms
63,760 KB
testcase_05 WA -
testcase_06 AC 327 ms
56,992 KB
testcase_07 AC 555 ms
65,424 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 298 ms
53,068 KB
testcase_11 AC 307 ms
52,976 KB
testcase_12 AC 310 ms
57,228 KB
testcase_13 AC 323 ms
57,012 KB
testcase_14 AC 338 ms
57,072 KB
testcase_15 AC 321 ms
57,112 KB
testcase_16 AC 339 ms
57,168 KB
testcase_17 AC 297 ms
53,020 KB
testcase_18 WA -
testcase_19 AC 317 ms
56,984 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