結果

問題 No.504 ゲーム大会(ランキング)
ユーザー 💕💖💞💕💖💞
提出日時 2017-06-24 18:50:21
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 1,045 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 10,664 ms
コンパイル使用メモリ 428,624 KB
実行使用メモリ 88,136 KB
最終ジャッジ日時 2024-04-30 14:45:31
合計ジャッジ時間 22,589 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 321 ms
56,700 KB
testcase_01 AC 308 ms
56,692 KB
testcase_02 AC 310 ms
56,856 KB
testcase_03 AC 303 ms
56,772 KB
testcase_04 AC 312 ms
56,724 KB
testcase_05 AC 306 ms
56,696 KB
testcase_06 AC 300 ms
56,668 KB
testcase_07 AC 1,011 ms
87,668 KB
testcase_08 AC 1,017 ms
87,764 KB
testcase_09 AC 1,016 ms
87,528 KB
testcase_10 AC 1,045 ms
87,656 KB
testcase_11 AC 1,002 ms
87,828 KB
testcase_12 AC 988 ms
88,136 KB
testcase_13 AC 958 ms
86,956 KB
testcase_14 AC 1,011 ms
87,576 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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