結果

問題 No.504 ゲーム大会(ランキング)
ユーザー 💕💖💞
提出日時 2017-06-24 18:50:21
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 1,034 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 11,255 ms
コンパイル使用メモリ 426,916 KB
実行使用メモリ 88,024 KB
最終ジャッジ日時 2024-11-20 10:14:35
合計ジャッジ時間 23,026 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args : Array<String>) {
         ^
Main.kt:15:15: warning: the expression is unused
      else -> null
              ^

ソースコード

diff #

fun main(args : Array<String>) {
  val n = readLine()!!.toInt()
  var head = readLine()!!.toInt()
  var rank = 1
  println(rank)
  val scores = (2..n).map {
    readLine()!!.toInt()
  }
  scores.map { score ->
    when  {
      score > head  -> {
        rank += 1
        head  = head
      }
      else -> null
    }
    println( rank )
  }
}
0