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

分析一下79B以及80多B的代码差别在哪里

Posted by Eov_Second at 2016-12-30 17:13:22 on Problem 2405
这题的公式是三次根号下(D^3 - 6V/PI),也就是
cbrt(D*D*D-V/acos(-1)*6),这大概是81B代码的写法

其实acos(0)是PI/2,分子分母都除以2就好了,于是可以简化为
cbrt(D*D*D-V/acos(0)*3),这样就变成了80B

更进一步,其实sin(PI/6)=0.5,那么6V/PI = V/(PI/6) = V/asin(0.5),式子变成了
cbrt(D*D*D-V/asin(0.5)),由于0.5前面的0可以省略,所以最终结果就是

cbrt(D*D*D-V/asin(.5))

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