結果

問題 No.564 背の順
コンテスト
ユーザー 💕💖💞
提出日時 2017-09-09 01:03:34
言語 Kotlin
(2.4.21 + ACL)
コンパイル:
kotlinc -cp /opt/aclib/ac_library.jar _filename_ -include-runtime -d main.jar
実行:
java -cp main.jar:/opt/aclib/ac_library.jar _class_
結果
WA  
実行時間 -
コード長 575 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 7,651 ms
コンパイル使用メモリ 514,068 KB
実行使用メモリ 48,732 KB
最終ジャッジ日時 2026-09-27 00:38:58
合計ジャッジ時間 10,831 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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")
    }
  }
}
0