Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
自己推公式很简单的 将总人数的分成两部分 然后Cn2加起来就行 高中时的排列问题若为odd if(num%2){ value=num/2; printf("%d\n",value*(value-1)/2+(value+1)*value/2); } 若为even printf("%d\n",(num/2)*(num/2-1));//这里是除以2后再乘以2 因为是偶数所以是对称的 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator