首页 > ACM题库 > HDU-杭电 > hdu 4157-slalom-分治-[解题报告]hoj
2015
05-23

hdu 4157-slalom-分治-[解题报告]hoj

Slalom

问题描述 :

Egypt

In spite of the scarcity of snowfall in Syria, interest in winter sports is growing in the country, especially with regard to skiing. Many people spend several weekends or even full weeks improving their skills in the mountains.
In this problem we deal with only one of the multiple alpine skiing disciplines: slalom. A course is constructed by laying out a series of gates, which are formed by two poles. The skier must pass between the two poles forming each gate. The winner is the skier who takes the least time to complete the course while not missing any of the gates.
You have recently started to learn to ski, but you have already set yourself the goal of taking part in the Winter Olympic Games of 2022, for which Syria will presumably present a candidature. As part of the theoretical training, you need to write a program that calculates, given a starting point and a series of gates, the minimum-length path starting from the point given and passing through each gate until you reach the last one, which is the finish line. You may assume that the gates are horizontal and are ordered from highest to lowest, so that you need to pass through them in order. You consider yourself an accomplished skier, so you can make any series of turns, no matter how difficult, and your only concern is minimizing the total length of the path.

输入:

The first line of each case gives the number of gates n (1 ≤ n ≤ 1 000). The next line contains two floating point numbers, the Cartesian coordinates x and y of the starting position, in that order. Next come n lines with three floating point numbers each, y x1 x2, meaning that the next gate is a horizontal line from (x1,y) to (x2,y). You can safely assume that x1 <x2. The values of y are strictly decreasing and are always smaller than that of the starting position.The last gate represents the finish line. All coordinates are between -500 000 and 500 000,inclusive. A value of 0 for n means the end of the input. A blank line follows each case.

输出:

The first line of each case gives the number of gates n (1 ≤ n ≤ 1 000). The next line contains two floating point numbers, the Cartesian coordinates x and y of the starting position, in that order. Next come n lines with three floating point numbers each, y x1 x2, meaning that the next gate is a horizontal line from (x1,y) to (x2,y). You can safely assume that x1 <x2. The values of y are strictly decreasing and are always smaller than that of the starting position.The last gate represents the finish line. All coordinates are between -500 000 and 500 000,inclusive. A value of 0 for n means the end of the input. A blank line follows each case.

样例输入:

2 
0 2 
1 1 2  
0 0.5 3  
 
3 
0 4 
3 1 2 
2 -1 0 
1 1 2  
 
0 

样例输出:

2.41421356237 
4.24264068712 


参考:http://blog.csdn.net/abc123456789cbaabc/article/details/8654471


  1. Pingback: Crack Sealant

  2. Pingback: Portugal

  3. Pingback: 11 inch dildo

  4. Pingback: تعمیر یخچال در محل

  5. Pingback: strapless dildo

  6. Pingback: how often should couples have sex

  7. Pingback: ترمیم مو، کاشت مو ، مو طبیعی

  8. Pingback: ترمیم مو و کاشت مو

  9. Pingback: فروش دوربین های مدار بسته مخفی

  10. Pingback: نصب و اجرای دوربین مداربسته

  11. Pingback: http://www.powsolnet.com/index.php?option=com_k2&view=itemlist&task=user&id=1010914

  12. Pingback: sex toys for couples

  13. Pingback: طراحی سایت

  14. Pingback: فروش دوربین های مدار بسته مخفی

  15. Pingback: نصب و اجرای دوربین مداربسته

  16. Pingback: ترمیم مو و کاشت مو

  17. Pingback: نصب دوربین های مدار بسته

  18. Pingback: glass candy juicer dildo

  19. Pingback: magic wand massager

  20. Pingback: طراحی وب سایت

  21. Pingback: Vneck middleweight gi

  22. Pingback: sex toys

  23. Pingback: نصب دوربین های مدار بسته

  24. Pingback: discount sex toy

  25. Pingback: sticky carpet protector

  26. Pingback: Magnet paper

  27. Pingback: ساخت اپل ایدی

  28. Pingback: {دوربین مداربسته|دوربین مداربسته سامسونگ|

  29. Pingback: stimulating gel

  30. Pingback: کفسابی

  31. Pingback: وکیل پایه یک

  32. Pingback: toys for couples

  33. Pingback: strap sex toys

  34. Pingback: strap on dildo

  35. Pingback: best adult sex games

  36. Pingback: adamandeve.com

  37. Pingback: buy kvass

  38. Pingback: cock masturbator

  39. Pingback: G Vibrator

  40. Pingback: tokaido white martial arts uniform

  41. Pingback: bangal ka jadu

  42. Pingback: driving tips

  43. Pingback: Mikemaid7447

  44. Pingback: bangal ka jadu

  45. Pingback: Cock ring

  46. Pingback: Nipple Toys

  47. Pingback: Anal toys

  48. Pingback: مقالات دوربین مدار بسته

  49. Pingback: adam and eve

  50. Pingback: adam & eve

  51. Pingback: Butt plugs

  52. Pingback: Dildo

  53. Pingback: accounting

  54. Pingback: the rabbit vibrator

  55. Pingback: آموزش نصب دوربین مدار بسته

  56. Pingback: personal lubricant reviews

  57. Pingback: triple stimulation

  58. Pingback: couple watching porn

  59. Pingback: XXXL sizes martial arts uniforms

  60. Pingback: php online store

  61. Pingback: manufactured

  62. Pingback: online auction

  63. Pingback: resolume serial keys

  64. Pingback: Greenwood

  65. Pingback: Download Xxxtentacion Mixtapes

  66. Pingback: Sage Gemini

  67. Pingback: Dizzee Rascal

  68. Pingback: bar display liquor bottles

  69. Pingback: Tam Coc Day Tour

  70. Pingback: port

  71. Pingback: revize zdvihacich zarizeni

  72. Pingback: 50 Cent

  73. Pingback: download full version pc games

  74. Pingback: Proforce 7 oz poly/cotton white uniform

  75. Pingback: http://pouyabin.com

  76. Pingback: urgent care los angeles

  77. Pingback: foreplay for him

  78. Pingback: ترمیم مو بیماران

  79. Pingback: sex lotion

  80. Pingback: adult sex toy

  81. Pingback: anal beads tumblr

  82. Pingback: rechargeable bullet vibrator

  83. Pingback: new things to try in bed for couples

  84. Pingback: real feel vibrator

  85. Pingback: vibrating bullet

  86. Pingback: اسکی فضایی

  87. Pingback: خرید اپل ایدی تحویل انی

  88. Pingback: male p spot toys

  89. Pingback: اجاره ويلا در لواسان

  90. Pingback: adam and eve

  91. Pingback: real skin feel dildo

  92. Pingback: kala jadu

  93. Pingback: خرید اپل ایدی تحویل انی

  94. Pingback: worktop protection

  95. Pingback: magnets

  96. Pingback: مشخصات تردمیل خانگی

  97. Pingback: tamper evident tape

  98. Pingback: polythene manufacturer

  99. Pingback: best male masturbator

  100. Pingback: Sex Toys

  101. Pingback: adam and eve

  102. Pingback: nude

  103. Pingback: adam and eve

  104. Pingback: adult

  105. Pingback: php web programming

  106. Pingback: خرید اپل ایدی

  107. Pingback: before oral sex

  108. Pingback: colorful dildos

  109. Pingback: bullet vibrator review

  110. Pingback: what is the best

  111. Pingback: biotech stocks

  112. Pingback: traditional anime

  113. Pingback: vpn خرید ارزان

  114. Pingback: Punching bag with scoring zones

  115. Pingback: realistic dong

  116. Pingback: adam and eve sex toy

  117. Pingback: sex toys for couples

  118. Pingback: clitoral stimulation

  119. Pingback: ترمیم مو

  120. Pingback: Minihaziko

  121. Pingback: tratamento de Alcoolismo

  122. Pingback: home page

  123. Pingback: Masturbator Review

  124. Pingback: anal trainer toy

  125. Pingback: adam and eve sex toys

  126. Pingback: Precision

  127. Pingback: relative strength

  128. Pingback: How to Use Ben Wa Balls

  129. Pingback: Best Male Stroker

  130. Pingback: femalelibidoreviews

  131. Pingback: lifelike dildo

  132. Pingback: Vibrator G Spot

  133. Pingback: g spot

  134. Pingback: male masterbator

  135. Pingback: glass toys

  136. Pingback: vibe

  137. Pingback: wireless massager

  138. Pingback: anal vibrator review

  139. Pingback: app download for pc

  140. Pingback: sauerkraut juice

  141. Pingback: Service

  142. Pingback: free laptop games download

  143. Pingback: apps for pc download

  144. Pingback: app download for windows

  145. Pingback: app download for windows 10

  146. Pingback: anal butt plug

  147. Pingback: sex dildo

  148. Pingback: babydoll lingerie

  149. Pingback: Adam and Eve

  150. Pingback: Adam and Eve

  151. Pingback: make penis harder

  152. Pingback: Vibrator Kit

  153. Pingback: China men's burn out t shirts manufacturer

  154. Pingback: Vibrating Cock Ring

  155. Pingback: A\u0026E Beginner's Power Pump

  156. Pingback: best g spot massager

  157. Pingback: Waterproof Vibrator

  158. Pingback: penis sleeve

  159. Pingback: jbeatz

  160. Pingback: sex toys

  161. Pingback: vibrator pink

  162. Pingback: magic wand

  163. Pingback: g-spot massager

  164. Pingback: anal sex vibrators

  165. Pingback: adult sex toy

  166. Pingback: sex toys

  167. Pingback: Fuel injector

  168. Pingback: دوربین مداربسته

  169. Pingback: Google

  170. Pingback: robert

  171. Pingback: adult sex toy

  172. Pingback: pc games for windows xp

  173. Pingback: longer sex

  174. Pingback: Sripatum university

  175. Pingback: end of lease cleaning Melbourne reviews

  176. Pingback: best sex gel

  177. Pingback: adult sex toy

  178. Pingback: Personal Lubricant

  179. Pingback: Bondage Toys

  180. Pingback: Masturbator

  181. Pingback: Dolphin Dildo

  182. Pingback: Best Female Arousal Products

  183. Pingback: Rabbit Vibrator

  184. Pingback: Adam and Eve Butterfly Kiss

  185. Pingback: Magic Wand Vibrator

  186. Pingback: what is the best luxury sex toys

  187. Pingback: rabbit vibrator

  188. Pingback: adam and eve

  189. Pingback: Google