結果

問題 No.490 yukiソート
ユーザー 💕💖💞💕💖💞
提出日時 2017-04-01 20:16:51
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 442 bytes
コンパイル時間 12,395 ms
コンパイル使用メモリ 438,368 KB
実行使用メモリ 74,496 KB
最終ジャッジ日時 2024-04-30 12:44:02
合計ジャッジ時間 22,972 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 273 ms
57,012 KB
testcase_01 WA -
testcase_02 AC 276 ms
57,000 KB
testcase_03 AC 273 ms
56,892 KB
testcase_04 AC 311 ms
57,076 KB
testcase_05 AC 319 ms
57,108 KB
testcase_06 AC 302 ms
57,080 KB
testcase_07 AC 326 ms
57,220 KB
testcase_08 AC 304 ms
57,268 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 283 ms
56,984 KB
testcase_25 AC 273 ms
57,020 KB
testcase_26 AC 281 ms
57,080 KB
testcase_27 AC 273 ms
57,104 KB
testcase_28 AC 274 ms
57,104 KB
testcase_29 AC 269 ms
56,964 KB
testcase_30 AC 273 ms
57,092 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String> ) {
         ^

ソースコード

diff #

fun main(args: Array<String> ) {
  val n  = readLine()!!.toInt()
  val ts:MutableList<Int> = readLine()!!.split(" ").map { x -> x.toInt() }.toMutableList()
  (1..2*n - 3).map { i ->
    for(p in (0..i) ) {
      val q = i - p 
      if( n <= q ) { continue } 
      if( p >= q ) { break }
      if(ts[p] > ts[q]) {
          val swap = ts[p]
          ts[p] = ts[q]
          ts[q] = swap
      }
    }
  } 
  println(ts.joinToString(" ") )
}
0