(n N).
n N (, ), . , , , ... N ; , (, O (m), m); , - , , .
n N (, 99 ), ( , , ) . Fisher-Yates shuffle, O (n).
:
- , n N,
- , n, " ", N,
- , ,
- If I don’t know the values ahead of time, I’d run two options on many different (n, N) pairs several times to try to better understand how to work out a balance,
source
share