【BZOJ】【2729】【HNOI2012】排队
排列组合+高精度
Orz PoPoQQQ
引用题解:
嗯……学习了一下python= =懒的写高精了
1 /************************************************************** 2 Problem: 2729 3 User: Tunix 4 Language: Python 5 Result: Accepted 6 Time:832 ms 7 Memory:6360 kb 8 ****************************************************************/ 9 10 def A(n): 11 re=1 12 for i in range(1,n+1): 13 re*=i 14 return re 15 def C(n,m): 16 if n<m: 17 return ; 18 return A(n)//A(m)//A(n-m) 19 n,m=[int(i) for i in raw_input().split()] 20 print m*A(n+1)*2*A(m-1)*C(n+2,m-1)+(A(n+2)-A(n+1)*2)*A(m)*C(n+3,m)