結果

問題 No.564 背の順
ユーザー scachescache
提出日時 2017-11-22 12:53:21
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 369 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 10,871 ms
コンパイル使用メモリ 441,800 KB
実行使用メモリ 58,000 KB
最終ジャッジ日時 2024-04-30 16:23:59
合計ジャッジ時間 14,208 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 307 ms
57,960 KB
testcase_01 AC 305 ms
58,000 KB
testcase_02 AC 313 ms
57,940 KB
testcase_03 AC 316 ms
57,864 KB
testcase_04 AC 305 ms
57,812 KB
testcase_05 AC 328 ms
57,868 KB
testcase_06 AC 310 ms
57,868 KB
testcase_07 AC 369 ms
57,956 KB
testcase_08 AC 310 ms
57,828 KB
testcase_09 AC 299 ms
57,884 KB
testcase_10 AC 312 ms
57,796 KB
testcase_11 AC 301 ms
57,952 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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