7.16T1

This is the road the water problem! ? Anyway chiefs say the water, then he water with it, I do not think anyway

I really did not expect this question to the 30 yard line, but this question prove that I now have a sensitivity to the slightest pressure like, thought to be like the pressure and came up with state-like pressure, but I could not even question did not understand, the sample did not do it, I just lied dotted

This question is to use a state representative of this product was bought, and 0 means not bought because every time he has come up with items which may, of course, also possible to come up with nothing, then this state there are three sources

1. The buy items not bought

2. The items bought bought

3. The buy nothing

In fact, 2 and 3 are the same, are transferred from the current state to the current state, but 2 and 3 common to the probability that we can not directly, it can only use one minus the probability of occurrence of the first case, we try out about transfer equation

f[i]=∑(f[i-j]*p[j])+(1-∑p[j])*f[i]+1

With the above that this thing should be on a good understanding j represents 1 taken out of that, of course, if necessary, make it into the first j items, that is, it is first a few, this should be shaped pressure common routine of it, this is because +1 whether you come from a state that you have to buy more time, in fact, +1 depends on how you understand, he should be able to have a different way of understanding, we have to look at this formula shift item, he becomes a whole look

f[i]=(∑(f[i-j]*p[j])+1) / ∑p[j]

Then transferred pleasant enough

Guess you like

Origin www.cnblogs.com/hzjuruo/p/11201870.html