Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

对,用double,边乘边除。并且注意输出格式。

Posted by hmh0512 at 2010-08-03 09:44:00 on Problem 1942
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator