mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-15 13:10:59 +00:00
Re-translate the Japanese version (#1871)
* Retranslate Japanese docs with GPT-5.4 * Retranslate Japanese code with GPT-5.4
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
// File: climbing_stairs_test.go
|
||||
// Created Time: 2023-07-18
|
||||
// Author: Reanon (793584285@qq.com)
|
||||
|
||||
package chapter_dynamic_programming
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestClimbingStairsBacktrack(t *testing.T) {
|
||||
n := 9
|
||||
res := climbingStairsBacktrack(n)
|
||||
fmt.Printf("%d 段の階段を登る方法は %d 通り\n", n, res)
|
||||
}
|
||||
|
||||
func TestClimbingStairsDFS(t *testing.T) {
|
||||
n := 9
|
||||
res := climbingStairsDFS(n)
|
||||
fmt.Printf("%d 段の階段を登る方法は %d 通り\n", n, res)
|
||||
}
|
||||
|
||||
func TestClimbingStairsDFSMem(t *testing.T) {
|
||||
n := 9
|
||||
res := climbingStairsDFSMem(n)
|
||||
fmt.Printf("%d 段の階段を登る方法は %d 通り\n", n, res)
|
||||
}
|
||||
|
||||
func TestClimbingStairsDP(t *testing.T) {
|
||||
n := 9
|
||||
res := climbingStairsDP(n)
|
||||
fmt.Printf("%d 段の階段を登る方法は %d 通り\n", n, res)
|
||||
}
|
||||
|
||||
func TestClimbingStairsDPComp(t *testing.T) {
|
||||
n := 9
|
||||
res := climbingStairsDPComp(n)
|
||||
fmt.Printf("%d 段の階段を登る方法は %d 通り\n", n, res)
|
||||
}
|
||||
|
||||
func TestClimbingStairsConstraintDP(t *testing.T) {
|
||||
n := 9
|
||||
res := climbingStairsConstraintDP(n)
|
||||
fmt.Printf("%d 段の階段を登る方法は %d 通り\n", n, res)
|
||||
}
|
||||
|
||||
func TestMinCostClimbingStairsDPComp(t *testing.T) {
|
||||
cost := []int{0, 1, 10, 1, 1, 1, 10, 1, 1, 10, 1}
|
||||
fmt.Printf("入力された階段のコストリストは %v\n", cost)
|
||||
|
||||
res := minCostClimbingStairsDP(cost)
|
||||
fmt.Printf("階段を登り切る最小コストは %d\n", res)
|
||||
|
||||
res = minCostClimbingStairsDPComp(cost)
|
||||
fmt.Printf("階段を登り切る最小コストは %d\n", res)
|
||||
}
|
||||
Reference in New Issue
Block a user