20201130: fix data

This commit is contained in:
VicRen
2020-11-30 09:14:40 +08:00
parent edc052bc77
commit 508e8c9c08

View File

@@ -1,13 +1,18 @@
package main package main
import "fmt" import (
"fmt"
"sort"
)
var prices = []int{6, 8, 12, 14, 18, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44} var prices = []int{6, 8, 12, 14, 18, 22, 24, 26, 28, 32}
var pricesWithAll = []int{6, 8, 12, 12, 12, 12, 12, 14, 14, 18, 22, 22, 22, 24, 24, 26, 26, 26, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44} var pricesWithAll = []int{6, 8, 12, 12, 12, 12, 12, 14, 14,
18, 22, 22, 22, 24, 24, 26, 26, 26, 26, 28, 32, 30, 30, 30, 34, 36, 38, 38, 38, 38, 40, 44}
func main() { func main() {
fmt.Println(sumCoins(50, prices)) fmt.Println(sumCoins(50, prices))
fmt.Println(sumCoins(100, prices)) fmt.Println(sumCoins(100, prices))
sort.Ints(pricesWithAll)
fmt.Println("paid = 50", sumCoins(50, pricesWithAll)) fmt.Println("paid = 50", sumCoins(50, pricesWithAll))
fmt.Println("paid = 100", sumCoins(100, pricesWithAll)) fmt.Println("paid = 100", sumCoins(100, pricesWithAll))
} }