結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー face4
提出日時 2021-04-10 18:07:39
言語 Kotlin
(2.1.0)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 14,096 ms
コンパイル使用メモリ 440,328 KB
実行使用メモリ 72,600 KB
最終ジャッジ日時 2024-06-26 06:58:51
合計ジャッジ時間 23,036 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
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