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 |
对,用double,边乘边除。并且注意输出格式。In Reply To:建议大家用double算C(n,k)不容易中间过程溢出 Posted by:machinewu at 2010-04-10 19:13:24 >全部变量用double,不用long long ,求组合数,边乘边除,不容易溢出。注意最后的格式输>出:cout.setf(ios::fixed); >cout.precision(0); >cout<<ans<<endl; >或者scanf("%.0f\n",ans); Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator