結果

問題 No.564 背の順
ユーザー scachescache
提出日時 2017-11-22 12:53:21
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 352 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 12,236 ms
コンパイル使用メモリ 412,584 KB
実行使用メモリ 54,220 KB
最終ジャッジ日時 2023-08-12 21:18:18
合計ジャッジ時間 17,689 ms
ジャッジサーバーID
(参考情報)
judge14 / judge7
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 351 ms
54,012 KB
testcase_01 AC 342 ms
53,896 KB
testcase_02 AC 349 ms
54,100 KB
testcase_03 AC 340 ms
54,164 KB
testcase_04 AC 341 ms
53,932 KB
testcase_05 AC 352 ms
54,184 KB
testcase_06 AC 351 ms
54,220 KB
testcase_07 AC 344 ms
54,004 KB
testcase_08 AC 351 ms
54,220 KB
testcase_09 AC 344 ms
53,776 KB
testcase_10 AC 345 ms
53,880 KB
testcase_11 AC 345 ms
53,932 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