結果

問題 No.564 背の順
ユーザー ichibanshiboriichibanshibori
提出日時 2018-05-03 19:13:23
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 293 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 10,027 ms
コンパイル使用メモリ 432,392 KB
実行使用メモリ 57,140 KB
最終ジャッジ日時 2024-04-30 18:30:36
合計ジャッジ時間 14,309 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 293 ms
57,140 KB
testcase_01 AC 287 ms
57,132 KB
testcase_02 AC 288 ms
56,904 KB
testcase_03 AC 279 ms
57,024 KB
testcase_04 AC 280 ms
57,056 KB
testcase_05 AC 287 ms
56,952 KB
testcase_06 AC 288 ms
56,952 KB
testcase_07 AC 276 ms
57,008 KB
testcase_08 AC 281 ms
56,924 KB
testcase_09 AC 283 ms
56,980 KB
testcase_10 AC 279 ms
57,004 KB
testcase_11 AC 276 ms
57,072 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args : Array<String>) {
         ^

ソースコード

diff #

fun main(args : Array<String>) {
	val hnLst = (readLine() ?: "").run { split(" ") }.map { it.toInt() }
	val hLst = (1..(hnLst[1] - 1)).map { readLine() ?: "" }.map { it.toInt() }

	hLst.filter { it > hnLst[0] }
		.count()
		.let { it + 1 }
		.let {
			when (it % 10) {
				1 -> "${it}st"
				2 -> "${it}nd"
				3 -> "${it}rd"
				else -> "${it}th"
			}
		}
		.let { println(it) }
}
0