Canadian Computing Competition: 2010 Stage 1, Senior #3
There is a very unusual street in your neighbourhood. This street forms a perfect circle, and the circumference of the circle is
You also have special firehoses which follow the curve of the street. However, you wish to keep the length of the longest hose you require to a minimum.
Your task is to place
Input Specification
The first line of input will be an integer
Output Specification
On one line, output the minimum integral length of hose required so that every house can connect to its nearest fire hydrant with that length of hose.
Sample Input
4
0
67000
68000
77000
2
Output for Sample Input
5000
Comments
idk but why H is so small, (brute force pass?).I think H should be (H<=1e5), i pass this problem with O(h.log(1e6))
The problem does not specify whether the location of each fire hydrant has to be an integer and whether the length of the hoses can contain a decimal. This should be added to the question as some of the solutions are different if you assume that the lengths and positions are not limited to integers.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
Not sure if this fits here, but for anyone who wants to practice binary search, here's some good ones: https://codeforces.com/edu/course/2/lesson/6/2/practice
There's some video explanations here: https://codeforces.com/edu/course/2/lesson/6/2
water is wet.
Can the length of the hoses contain decimals?
I think it can be shown that the only decimal will be point 5, in which case I think you just round up.
The original CEMC test data is now worth 80% of the marks. New cases, worth the remaining 20%, have been added.
All submissions have been rejudged.