[Solved] Modulus in language C [closed]
the newmove should be 21 newmove=(21-x1) % (k1 + 1) + x1; (21-12) % (12 + 1) + 12 ( 9 % 13 ) + 12 9 + 12 21 solved Modulus in language C [closed]
the newmove should be 21 newmove=(21-x1) % (k1 + 1) + x1; (21-12) % (12 + 1) + 12 ( 9 % 13 ) + 12 9 + 12 21 solved Modulus in language C [closed]
n is large while r is small, you are better off compute nCr by n(n-1)…(n-r+1)/(1*2*…*r) You may need to find multiplicate inverse of 1, 2, … r mod 10^9+7 solved nCr mod 10^9 + 7 for n
In case someone gets to the question wondering how to use modulus or ‘getting the rest of a division’ (%): echo 5 % 3; // outputs 2 (You can take a look at a step-by-step output after this first part) This is the commented function: function func_name($docnum){ // make sure there is just numbers in … Read more