package main import ( "fmt" ) func main() { a := 0 fmt.Scan(&a) arr := make([]int, a+1) for i := 0; i < a; i++ { fmt.Scan(&arr[i]) arr[i]-- } fmt.Printf("%v", answer(arr)) } func answer(a []int) int { rooms := len(a) dp := make([]int, rooms) f...