結果

問題 No.490 yukiソート
ユーザー 💕💖💞💕💖💞
提出日時 2017-04-01 20:23:03
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 424 ms / 2,000 ms
コード長 448 bytes
コンパイル時間 13,591 ms
コンパイル使用メモリ 427,164 KB
実行使用メモリ 56,268 KB
最終ジャッジ日時 2023-08-12 17:38:57
合計ジャッジ時間 27,159 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 286 ms
52,832 KB
testcase_01 AC 291 ms
52,808 KB
testcase_02 AC 298 ms
52,816 KB
testcase_03 AC 289 ms
52,832 KB
testcase_04 AC 324 ms
53,080 KB
testcase_05 AC 323 ms
53,132 KB
testcase_06 AC 328 ms
52,880 KB
testcase_07 AC 323 ms
52,860 KB
testcase_08 AC 325 ms
52,880 KB
testcase_09 AC 326 ms
52,784 KB
testcase_10 AC 328 ms
53,012 KB
testcase_11 AC 336 ms
52,856 KB
testcase_12 AC 321 ms
52,784 KB
testcase_13 AC 323 ms
52,916 KB
testcase_14 AC 417 ms
56,220 KB
testcase_15 AC 416 ms
55,988 KB
testcase_16 AC 415 ms
56,088 KB
testcase_17 AC 419 ms
56,016 KB
testcase_18 AC 419 ms
56,088 KB
testcase_19 AC 421 ms
56,268 KB
testcase_20 AC 417 ms
56,220 KB
testcase_21 AC 424 ms
56,244 KB
testcase_22 AC 419 ms
56,040 KB
testcase_23 AC 418 ms
55,996 KB
testcase_24 AC 287 ms
52,748 KB
testcase_25 AC 290 ms
52,508 KB
testcase_26 AC 287 ms
52,592 KB
testcase_27 AC 288 ms
52,592 KB
testcase_28 AC 288 ms
52,664 KB
testcase_29 AC 284 ms
52,672 KB
testcase_30 AC 289 ms
52,656 KB
testcase_31 AC 289 ms
52,668 KB
testcase_32 AC 289 ms
52,744 KB
testcase_33 AC 291 ms
52,556 KB
testcase_34 AC 292 ms
52,908 KB
testcase_35 AC 286 ms
52,628 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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()
  for(i in (1..2*n - 3 - 1)) { 
    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