結果

問題 No.490 yukiソート
ユーザー tsuchinagatsuchinaga
提出日時 2019-02-26 14:33:22
言語 Go
(1.22.1)
結果
TLE  
実行時間 -
コード長 483 bytes
コンパイル時間 11,590 ms
コンパイル使用メモリ 210,836 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-04 04:59:07
合計ジャッジ時間 17,051 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 29 ms
4,380 KB
testcase_05 AC 29 ms
4,376 KB
testcase_06 AC 29 ms
4,380 KB
testcase_07 AC 29 ms
4,380 KB
testcase_08 AC 29 ms
4,380 KB
testcase_09 AC 29 ms
4,384 KB
testcase_10 AC 29 ms
4,376 KB
testcase_11 AC 29 ms
4,376 KB
testcase_12 AC 29 ms
4,380 KB
testcase_13 AC 29 ms
4,380 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, a int
	_, _ = fmt.Scan(&n)

	nums := make([]int, n)
	for i := range nums {
		_, _ = fmt.Scan(&a)
		nums[i] = a
	}

	for i := 1; i < 2*n-3; i++ {
		for p := 0; p <= n-2; p++ {
			for q := p + 1; q <= n-1; q++ {
				if p+q == i && nums[p] > nums[q] {
					nums[p], nums[q] = nums[q], nums[p]
				}
			}
		}
	}

	for i, a := range nums {
		fmt.Print(a)
		if i == len(nums)-1 {
			fmt.Printf("\n")
		} else {
			fmt.Printf(" ")
		}
	}
}
0