結果
| 問題 | No.564 背の順 |
| コンテスト | |
| ユーザー |
💕💖💞
|
| 提出日時 | 2017-09-09 01:03:34 |
| 言語 | Kotlin (2.3.20) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 575 bytes |
| 記録 | |
| コンパイル時間 | 9,395 ms |
| コンパイル使用メモリ | 475,656 KB |
| 実行使用メモリ | 56,872 KB |
| 最終ジャッジ日時 | 2026-05-14 14:26:11 |
| 合計ジャッジ時間 | 12,684 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 3 |
ソースコード
fun main( args : Array<String> ) {
val (h, n) = readLine()!!.split(" ").map { it.toInt() }
val ns = (1..n-1).map {
readLine()!!.toInt()
}.map {
Pair("Other", it)
}.toMutableList()
ns.add( Pair("Target", h) )
ns.sortedBy{
it.second * -1
}.mapIndexed { i,x ->
val (type, h) = x
Triple(type, i+1, h)
}.filter {
it.first == "Target"
}.let {
val rank = it.first().second
when {
rank == 1 -> println("1st")
rank == 2 -> println("2nd")
rank == 3 -> println("3rd")
else -> println("${rank}th")
}
}
}
💕💖💞