結果

問題 No.490 yukiソート
ユーザー fmhrfmhr
提出日時 2017-03-10 22:32:22
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 10,673 ms
コンパイル使用メモリ 212,660 KB
実行使用メモリ 9,008 KB
最終ジャッジ日時 2023-09-06 15:36:06
合計ジャッジ時間 15,811 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,760 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 70 ms
4,380 KB
testcase_05 AC 68 ms
4,376 KB
testcase_06 AC 71 ms
4,380 KB
testcase_07 AC 71 ms
4,380 KB
testcase_08 AC 72 ms
4,380 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"log"
)

func main() {
	var n int
	fmt.Scan(&n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
	}
	for i := 0; i < 2*n-3; i++ {
		for p := 0; p < i; p++ {
			for q := p + 1; q < n; q++ {
				// log.Println(i, p, q)
				if a[p] > a[q] {
					log.Println(a[p], a[q])
					a[p], a[q] = a[q], a[p]
				}
			}
		}
	}
	for i, b := range a {
		fmt.Print(b)
		if i < len(a)-1 {
			fmt.Print(" ")
		} else if i == len(a)-1 {
			fmt.Print("\n")
		}
	}
}
0