結果

問題 No.397 NO MORE KADOMATSU
ユーザー tsuchinagatsuchinaga
提出日時 2019-03-09 11:33:39
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 463 bytes
コンパイル時間 11,383 ms
コンパイル使用メモリ 210,472 KB
実行使用メモリ 24,528 KB
平均クエリ数 109.94
最終ジャッジ日時 2023-09-23 16:48:22
合計ジャッジ時間 14,462 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,556 KB
testcase_01 AC 25 ms
24,048 KB
testcase_02 AC 25 ms
23,892 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 25 ms
23,628 KB
testcase_10 WA -
testcase_11 AC 25 ms
24,288 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 25 ms
23,700 KB
testcase_17 AC 25 ms
23,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, a int
	_, _ = fmt.Scan(&n)

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

	change := make([]string, 0)
	sort.Slice(nums, func(i, j int) bool {
		if nums[i] < nums[j] {
			change = append(change, fmt.Sprintf("%d %d", i, j))
			return true
		}
		return false
	})

	fmt.Println(len(change))
	for _, c := range change {
		fmt.Println(c)
	}
	_, _ = fmt.Scan(&n)
}
0