Reprint Please specify the source Thank you: http://blog.csdn.net/vmurder/article/details/42964151
Exercises
There is a comment inside the code.
Attention:
Chinese characters in Python2 even if commented, ce (of course, because Python is run directly, not compiled, so show WA)
Well, the local Python3 doesn't care about it.
So my code needs to delete the Chinese note and 233.
Code:
# n! (A (n+1,2) *a (n+3,m) +2* (n+1) *a (n+2,m-1) *m) # First the boys casually put this is the n! kind of pendulum method. # and then add two teachers, there is a n+3 put the girl's position, # is the girl has a (n+3,m) species, but the teacher's position should be a (n+1,2) # and then if the two teachers throw to the boys when repeated, then need to insert a girl in the middle # that is, girls have a (n+2,m-1) species interpolation method , and the teacher is (n+1) method, # Note at this time need to enumerate which girl was placed in the middle of the teacher, there is a case of M. #呃, two teachers are also different, so at this time need to *2# the two teachers of the law is not repeated and includes all the circumstances of the # that we again like the above treatment two kinds of teachers when the number of girls ranked # can be solved and include all cases. # by yGY (id:18357) def mul (x, y): Re = 1for i in range (x, y + 1): Re = re * Ireturn ren, m = raw_input (). Split () n = int (n); m = Int (m) #print (Mul (1,n) * ((n+1) *n*mul (n+3-m+1,n+3) +2* (n+1) *m*mul (n+2-m+2,n+2)) print (Mul (1,n+1) *mul (n+4-m,n+2) * (N (n+3) +2*m))
"BZOJ2729" "HNOI2012" queueing combination number theory Python high precision