1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
// @Title: 鸡蛋掉落 (Super Egg Drop)
// @Author: 15816537946@163.com
// @Date: 2020-02-21 09:39:43
// @Runtime: 0 ms
// @Memory: 1.9 MB
func superEggDrop(K int, N int) int {
    moves := 0
    dp := [101]int{}
    for dp[K] < N {
        for i :=K;i>0;i-- {
            dp[i] += dp[i-1]+1
        }
        moves++
    }
    return moves
}