結果

問題 No.490 yukiソート
ユーザー fal_rndfal_rnd
提出日時 2019-02-19 16:31:54
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,314 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 13,504 ms
コンパイル使用メモリ 258,540 KB
実行使用メモリ 64,972 KB
最終ジャッジ日時 2024-04-28 05:15:02
合計ジャッジ時間 56,386 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 972 ms
64,172 KB
testcase_01 AC 999 ms
64,264 KB
testcase_02 AC 967 ms
64,324 KB
testcase_03 AC 978 ms
64,140 KB
testcase_04 AC 1,084 ms
64,508 KB
testcase_05 AC 1,095 ms
64,440 KB
testcase_06 AC 1,087 ms
64,436 KB
testcase_07 AC 1,113 ms
64,520 KB
testcase_08 AC 1,125 ms
64,496 KB
testcase_09 AC 1,117 ms
64,472 KB
testcase_10 AC 1,079 ms
64,276 KB
testcase_11 AC 1,086 ms
64,588 KB
testcase_12 AC 1,078 ms
64,600 KB
testcase_13 AC 1,106 ms
64,388 KB
testcase_14 AC 1,280 ms
64,860 KB
testcase_15 AC 1,290 ms
64,580 KB
testcase_16 AC 1,240 ms
64,744 KB
testcase_17 AC 1,250 ms
64,800 KB
testcase_18 AC 1,236 ms
64,700 KB
testcase_19 AC 1,287 ms
64,744 KB
testcase_20 AC 1,314 ms
64,972 KB
testcase_21 AC 1,300 ms
64,576 KB
testcase_22 AC 1,289 ms
64,520 KB
testcase_23 AC 1,276 ms
64,776 KB
testcase_24 AC 1,000 ms
64,040 KB
testcase_25 AC 996 ms
64,216 KB
testcase_26 AC 1,004 ms
64,052 KB
testcase_27 AC 993 ms
64,284 KB
testcase_28 AC 971 ms
64,140 KB
testcase_29 AC 982 ms
64,260 KB
testcase_30 AC 968 ms
64,168 KB
testcase_31 AC 1,015 ms
64,136 KB
testcase_32 AC 1,093 ms
64,240 KB
testcase_33 AC 1,011 ms
64,136 KB
testcase_34 AC 1,036 ms
64,048 KB
testcase_35 AC 1,061 ms
64,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.collection.mutable._

object KyoPRO{
	implicit class Swap[T](v:Seq[T]) {
		def swap(i:Int,j:Int):Unit = {
			val	t=v(i)
			v(i)=v(j)
			v(j)=t
		}
	}
}
import KyoPRO._

object Main {
	def main(A:Array[String])={
		val s = new java.util.Scanner(System.in)
		val n=s.nextInt
		val a=Array.fill(n)(s.nextInt)
		for(i<-0 to n*2-4){
			for(j<-(0 to n-2).takeWhile(j=>j<i-j)){
				if(i-j<n&&a(j)>a(i-j))
					a.seq.swap(j,i-j)
			}
		}
		println(a mkString " ")
	}
}
0