結果

問題 No.564 背の順
ユーザー scache
提出日時 2017-11-22 12:53:21
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 380 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 11,394 ms
コンパイル使用メモリ 434,132 KB
実行使用メモリ 57,984 KB
最終ジャッジ日時 2024-11-20 13:08:58
合計ジャッジ時間 17,002 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val h = sc.nextInt()
    val n = sc.nextInt()

    val c = 1 + (1 until n).map { sc.nextInt() }
            .filter { h < it }
            .count()

    val suf = when (c % 10) {
        1 -> "st"
        2 -> "nd"
        3 -> "rd"
        else -> "th"
    }

    println("$c$suf")
}
0