Nice problem. I tried many times yesterday to solve this problem. I used a standard algorithm that I have code for, but got wrong answer. Before I output the answer, I also check for validity of the solution by making sure that the mixture is stable before outputting it (otherwise ...
Thanks hewei. You're right, if the streets are of different lengths the probabilities will be different. When I created the problem I forgot to say that all streets have the same lengths.
Assuming this, the probabilities only depend on degree (and I can prove this).
Sorry for the controversy. Like I said, it was a bit shameless on my part, and if that angers others, I'll just stop doing it next time.
As for the problem, by smallest "expected amount of time" I mean the smallest average time that it would take Mrs. H to find Mr. H and take him home. The smallest ...
Yes, the output statement is a little vague. What little joey said is correct. Basically the problem asks for a list of intersections that Mrs. H visits, without repetition, that minimize the expected time (of finiding Mr.H and bringing him home). Thank you for the correction.
There are N types of objects , each with a value and a weight, and there are G people, each with a capacity. Each person can take at most one object from each type , but can take as many objects as one can carry. Find the maximal value that the G people can carry out ...
Hi I'm getting WA for this problem. It works on inputs I got from the official website. My algorithm is to do one flood-fill to mark all non-background pixels with a positive component number, then do a second flood-fill to mark all the dots on the die with a negative component number (negative of ...
Observer, thank you for your test cases. I got accepted on second try after reading it.
However, I don't think the test cases were that sensitive. I used double, and my code don't even have an epsilon. I don't think I needed to use epsilons as the boundary cases for the two different formulae ...