結果

問題 No.490 yukiソート
ユーザー tsuchinagatsuchinaga
提出日時 2019-02-26 14:41:46
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 13,374 ms
コンパイル使用メモリ 212,768 KB
実行使用メモリ 8,472 KB
最終ジャッジ日時 2023-09-04 05:33:18
合計ジャッジ時間 20,812 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 OLE -
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-1; p++ {
			q := i - p
			fmt.Println(i, p, q)
			if !(0 <= q && p < q && q <= n-1) {
				continue
			}
			if 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