結果

問題 No.564 背の順
ユーザー scachescache
提出日時 2017-11-22 12:49:03
言語 Kotlin
(1.9.10)
結果
WA  
実行時間 -
コード長 369 bytes
コンパイル時間 13,651 ms
コンパイル使用メモリ 422,660 KB
実行使用メモリ 54,708 KB
最終ジャッジ日時 2023-08-12 21:15:24
合計ジャッジ時間 18,300 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 346 ms
54,200 KB
testcase_01 AC 343 ms
54,044 KB
testcase_02 AC 353 ms
54,240 KB
testcase_03 WA -
testcase_04 AC 348 ms
54,144 KB
testcase_05 AC 350 ms
54,176 KB
testcase_06 AC 350 ms
54,208 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 340 ms
53,912 KB
testcase_10 AC 339 ms
54,220 KB
testcase_11 AC 341 ms
54,104 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) {
        1 -> "st"
        2 -> "nd"
        3 -> "rd"
        else -> "th"
    }

    println("$c$suf")
}
0