結果

問題 No.564 背の順
コンテスト
ユーザー ichibanshibori
提出日時 2018-05-03 19:13:23
言語 Kotlin
(2.3.20)
コンパイル:
kotlinc _filename_ -include-runtime -d main.jar
実行:
kotlin main.jar
結果
AC  
実行時間 196 ms / 2,000 ms
コード長 381 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 8,718 ms
コンパイル使用メモリ 471,932 KB
実行使用メモリ 53,168 KB
最終ジャッジ日時 2026-05-14 18:50:49
合計ジャッジ時間 12,043 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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