1 / 5

10320 Cow Trouble! Help Please!!

10320 Cow Trouble! Help Please!!. ★★★☆☆ 題組: Contest Archive with Online Judge 題號: 10320 Cow Trouble! Help Please!! 解題者: 郭真爾 解題日期: 20 13 年 4 月 25 日 題意: 有一頭牛被一根長度 R 的繩子拴在一棟建築物 ABCD 的 B 點上 , 草地的範圍為無限大,求牛可以吃到的草的範圍。 Input 會給 l, w  和 R  表示建築物長寬和繩長; l,w,R< 10000 。 Output 要輸到小數點第 10 位。. 題意範例:

ayala
Télécharger la présentation

10320 Cow Trouble! Help Please!!

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 10320 Cow Trouble! Help Please!! • ★★★☆☆ • 題組:Contest Archive with Online Judge • 題號:10320 Cow Trouble! Help Please!! • 解題者:郭真爾 • 解題日期:2013年4月25日 • 題意:有一頭牛被一根長度R的繩子拴在一棟建築物ABCD的B點上,草地的範圍為無限大,求牛可以吃到的草的範圍。Input會給l, w 和R 表示建築物長寬和繩長;l,w,R< 10000。Output要輸到小數點第10位。

  2. 題意範例: 10 5 5 → l=10 , w=5 , R=5 10 4 8 → l=10 , w=4 , R=8 • 解法:用繩長R來分各種情況利用暴力法去計算面積 • 解法範例: (1) R<=w l=10 , w=5 , R=5 PI*R*R*3/4=58.9048622548

  3. (2) w<R<=l l=10 , w=4 , R=8 PI*R*R*3/4 + PI*(R-w)*(R-w)*1/4 = 163.3628179867 (3) l<R<=l+w Ans = PI*R*R*3/4 + PI*(R-w)*(R-w)*1/4 + PI*(R-l)*(R-l)*1/4

  4. (4) l+w<R Ans= PI*R*R*3/4 + PI*(R-w)*(R-w)*1/4 + PI*(R-l)*(R-l)*1/4 -扇形DMK -扇形AKN +多邊形ACDK

  5. 討論:#define PI 2*acos(0)

More Related