[期望dp] 绵羊跳弹簧 >>>>题目 [题目] T 组数据.对于每一组数据,有n+1 个格子从0 到n 标号,绵羊从0 号结点开始,每次若在 x 位置掷骰子,令掷出的数为num,则跳到 x+num 处. 另外还有 m 个弹簧,绵羊跳到一个有弹簧的格子上时,不需要掷骰子便可向右跳到某个位置(若此时仍有弹簧将继续向右跳),直到到达 n 或者超出 n 停止. 询问绵羊掷骰子的期望次数. [输入格式] 第一行为一个整数T,表示数据组数.接下来对于每组数据:首先一行两个数n, m,含义如题…
Kattis - bank [简单DP] Description Oliver is a manager of a bank near KTH and wants to close soon. There are many people standing in the queue wanting to put cash into their accounts after they heard that the bank increased the interest rates by 42% (f…
HDOJ 1501 Zipper [简单DP] Problem Description Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The first two strings can be mixed arbitrarily, but each must stay in i…