結果

問題 No.490 yukiソート
ユーザー fmhrfmhr
提出日時 2017-03-10 22:44:38
言語 Go
(1.22.1)
結果
TLE  
実行時間 -
コード長 529 bytes
コンパイル時間 12,561 ms
コンパイル使用メモリ 211,776 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-06 15:46:56
合計ジャッジ時間 15,914 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 24 ms
4,380 KB
testcase_05 AC 24 ms
4,376 KB
testcase_06 AC 24 ms
4,376 KB
testcase_07 AC 24 ms
4,380 KB
testcase_08 AC 26 ms
4,380 KB
testcase_09 AC 24 ms
4,380 KB
testcase_10 AC 24 ms
4,380 KB
testcase_11 AC 24 ms
4,380 KB
testcase_12 AC 24 ms
4,380 KB
testcase_13 AC 24 ms
4,376 KB
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"

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 p+q == i {
					if a[p] > a[q] {
						// log.Println(a[p], a[q])
						a[p], a[q] = a[q], a[p]
					}
				}
			}
		}
	}
	// sort.Ints(a)
	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