結果

問題 No.564 背の順
ユーザー scache
提出日時 2017-11-22 12:49:03
言語 Kotlin
(2.1.0)
結果
WA  
実行時間 -
コード長 369 bytes
コンパイル時間 10,178 ms
コンパイル使用メモリ 435,712 KB
実行使用メモリ 57,972 KB
最終ジャッジ日時 2024-11-20 13:06:22
合計ジャッジ時間 15,161 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
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) {
        1 -> "st"
        2 -> "nd"
        3 -> "rd"
        else -> "th"
    }

    println("$c$suf")
}
0