結果

問題 No.570 3人兄弟(その1)
ユーザー R_FR_F
提出日時 2017-11-22 10:27:55
言語 Go
(1.22.1)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 574 bytes
コンパイル時間 13,157 ms
コンパイル使用メモリ 212,032 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-17 14:10:33
合計ジャッジ時間 11,794 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main
import(
	"fmt"
	"sort"
)

func output(ele int, heightMap map[string]int){
	if ele == heightMap["A"]{
		fmt.Println("A")
	} else if ele == heightMap["B"]{
		fmt.Println("B")
	} else if ele == heightMap["C"]{
		fmt.Println("C")
	}
}

func main(){
	var heightA, heightB, heightC int
	fmt.Scan(&heightA, &heightB, &heightC)
	heightList := []int{heightA, heightB, heightC}
	sort.Sort(sort.IntSlice(heightList))
	heightMap := map[string]int{"A": heightA, "B": heightB, "C": heightC}

	for i := len(heightList) - 1; i >= 0; i--{
		output(heightList[i], heightMap)
	}
}
0