I agree with bubbled about Jasen's statement: Bubbled, I agree that you have to recognize that bullets disappear, but I disagree that you have to simulate each second; merely calculate collision timestamps
Error! I left out a case: corrected cases are: 20000 samples of this yields 0.371. This is close enough to bonanova's statement of 3/8 being spot on, that I'm looking forward EAGERLY to the simple analytical explanation :-)
I'm surprised that the choice of annihilation is so simple as these programs suggest. Perhaps there's a constraint I haven't comprehended yet. Suppose the bullets fired on one second intervals are b0, b1, b2, and b3, And suppose their velocities are v0, v1, v2, v3. Even the 4-bullet case seems to have several outcomes, one of which is that b2 catches b1 before b1 catches b0. Nowhere in these code bodies is there a three-bullet comparison. In fact, even that comparison isn't quite enough, as it's possible that b3 could catch b2 before b1 catches b0. Am I missing something in the code? or am i missing something in the problem?
I assume that ( 1 ) as the number of flags is bounded (between 100 and 1000), we can require enough memory to store a record for each found flag, and can declare how long a record is ( 2 ) a memory cell has finite precision, and that the dimensions of the maze could be arbitrarily greater than the largest value of a cell. So, although we could store some information about each found flag, we could NOT store coordinates. In fact we cannot even store coordinates of one spot (after all, we may have walked a googolplex number of steps in a straight line). ( 3 ) we are NOT permitted to leave anything in a square except a flag, and are not permitted to distinguish the orientation of the flag. Are these all true assumptions about the rules?
BMAD, I'm also having difficulty interpreting the words "...d has to decrease by two to keep the same median". The only median mentioned so far is the median of a and b. As Rob and Araver have said, the value of d has no effect on the median of a and b. So, should we interpret the fragment above as: "...d has to decrease by two to keep the same median of (a,b,c,d)"?
Araver, I'm assuming that the shortest path is what counts, and that a stakes assignment with two or three equal numbers counts as zero. I think the coin-flipping is window dressing...Of course, Bonanova's opinion is more reliable :-) Here's my answer at 8 steps: