Draw the drawer pulls

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/mybluesky1983/article/details/53590117

Apes are many programs written using lottery procedures are generally prizes equally.
Myself have learned a little, following a brief method of prize allocation. It is also heard. Silently down the.
Principle is as follows
assuming that there are N prizes to the start time is O, T is the period of the average length distribution finished.
The period of time is occupied by each prize M = T / N
time-specific prizes distributed in each M random rand (0, M)
is the first time a prize payment O + rand (0, M) ,
the second prize paid time O + M + rand (0, M),
so
code for a later time offer

Guess you like

Origin blog.csdn.net/mybluesky1983/article/details/53590117