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 |
wa的不是取余的原因用了double才过的,而且去掉取余更快 16MS double Com(int n, int k) { double a=1,b=1; while(k) { b*=k--; a*=n--; if((int)a % (int)b == 0) a /= b, b = 1; } return a/b; } 0MS double Com(int n, int k) { double a=1,b=1; while(k) { b*=k--; a*=n--; } return a/b; } 应该是强制转换的原因吧囧 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator