|
Cuntpunch posted:This does pretty much undermine the logic. Since it's explicitly said that the rope burns unevenly you can't reasonably burn from the other end. Because otherwise wouldn't the answer just be to fold the first rope in half, intersect either half-of-half point on it with the half point of the second rope, then light either end of the second rope? If each rope burns at the same rate forwards as it does backwards at every point along its length, the solution works just fine. The flame starting at one end of the first rope will burn through the first half-hours worth (however much rope that may be), while the flame starting at the other end will also burn through a half-hours worth of rope before they meet. The second rope is then the same situation in miniature - it doesn't matter how much length is remaining, you have a one-hour rope out of which a half-hour has been consumed, i.e. you have a half-hour rope. Folding over doesn't work because you have no way to figure out where the half-hour point is just by comparing length.
|
# ¿ Mar 16, 2016 15:11 |
|
|
# ¿ May 11, 2024 07:47 |
|
I haven't even looked at the code but just from the form of the question I'm guessing it's an unnecessary n2 algorithm.
|
# ¿ Jul 15, 2016 04:28 |