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

终于AC了,总结一些小提示

Posted by canyousayyes at 2012-07-16 11:13:58 on Problem 2500
一.题目给出的是直径,要化成半径才能计算面积。半径的类别必须是double。

二.圆周率用acos(-1)比较准确

三.四边形面积可以分拆成4个三角形计算,每个三角形都由两支向量组成。这两支向量实际上也是圆形上的两条半径,它们的极座标为(r, a)及(r, b)。面积为fabs(sin(b-a)*r*r/2)

四.同理,选点时可以直接比较sin值而无需计算面积。

五.虽然c*g有机会超出int的范围,但实际上可以拿前一个点的数值加上g再余n就可以,无需用__int64
具体写法为for (i=1, p[0]=0; i<c; i++) p[i]=(p[i-1]+g)%n;

这题不算太难,只是相当考验做几何题目的细心程度……

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