Algorithm for a number of M, N, N> M Such as Numbers, 1, 2, 3, 4, The results are as follows: 1 1 1 1 1 1 1 2 1 1 1 3 1 1 2 2 1 1 2 3 1 1 3 3 1 2 2 2 1 2 3 2 1 2 3 3 3 3 3 1 2 2 2 2 2 2 2, 3, 2, 2, 3, 3 2, 3, 3 3 3 3 3 3 That can be repeated, no order can be arbitrary,
CodePudding user response:
This fee head seem reluctant to think
CodePudding user response:
Yeah, don't want to waste brain,
Change your topic to, we see at a glance, you can do
12 take 3, you feel?? A clock dial, only a three pointer, 12 hours, turn a lap down, about the whole arrangement, will not repeat
So, according to the clock so write well, one revolution of the second hand, minute hand into one, one revolution of the minute hand and hour hand into a
Namely N into the system
CodePudding user response:
Two loops to solve
CodePudding user response:
O (n ^ m) recursion, n=3, m=4, 81, Not recursive directly write cycle 4 layer,
CodePudding user response:
So, if you still can't see, let's change the more straightforward 0,1,2,3,4,5,6,7,9 Take three
Does 000 001 002 003 -- -- -- -- --
009 010 -- -- -- -- -- --
999
He all not, repeat not
As for what N> M, in fact is a smoke screen, don't worth considering
N> The M is? Also is to use N as the base, not M as the base, how do you carry on how to carry, but when was the last show take a remainder (die), that is, the value of the current % M
CodePudding user response:
Oh, really is a distraction, I also lost, but the conclusion is correct, is not worth considering Above is fan, repair, or M hexadecimal
Who says decimal number cannot express 11 data, so don't consider "N" at M, this condition is used to confuse people