## Search found 23 matches

Thu Nov 02, 2006 1:34 am
Forum: Volume 111 (11100-11199)
Topic: 11132 - Dice from pennies
Replies: 10
Views: 4058
Hm... this is strange.

For case

Code: Select all

``````2D2
TTHHTT``````
how do you get 4??

Frank
Sun Oct 22, 2006 11:24 pm
Forum: Volume 111 (11100-11199)
Topic: 11119 - Chemical Attraction
Replies: 19
Views: 9005
Hi Little Joey, 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 do...
Fri Apr 07, 2006 9:55 pm
Forum: Volume 110 (11000-11099)
Topic: 11025 - Mr. And Mrs. Hamilton
Replies: 21
Views: 8150
By the way, your changing the name from Mr. Hamilton to Mr. Smith is either a very good joke, or a very funny Freudian slip. I like it.

Frank
Fri Apr 07, 2006 9:45 pm
Forum: Volume 110 (11000-11099)
Topic: 11025 - Mr. And Mrs. Hamilton
Replies: 21
Views: 8150
Hi,

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).

Thanks,
Frank Chu
Wed Apr 05, 2006 5:30 am
Forum: Volume 110 (11000-11099)
Topic: 11025 - Mr. And Mrs. Hamilton
Replies: 21
Views: 8150
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 ...
Mon Apr 03, 2006 4:23 pm
Forum: Volume 110 (11000-11099)
Topic: 11025 - Mr. And Mrs. Hamilton
Replies: 21
Views: 8150
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. And yes I am the guy w...
Thu Aug 26, 2004 12:54 pm
Forum: Volume 100 (10000-10099)
Topic: 10017 - The Never Ending Towers of Hanoi
Replies: 19
Views: 5604
Hi, Some pointers: 1) The sample output is wrong here. The first ouput case for 64 2 is wrong, which probably most people have noticed without asking. 2) Just in case you're using the iterative algorithm, be careful when n is odd. For n odd, you have to move the smallest disk 'counter-clockwise' in ...
Tue Aug 24, 2004 1:35 pm
Forum: Volume 101 (10100-10199)
Topic: 10130 - SuperSale
Replies: 76
Views: 23399
The problem is badly worded. 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. In...
Sat Aug 14, 2004 3:02 am
Forum: Volume 6 (600-699)
Topic: 657 - The die is cast
Replies: 46
Views: 22030
Strange, you posted 6 input cases and there's 7 output??

But I checked manually and my program seems to work for your test input cases...... unfortunate...

Please can anyone help me out here???
Frank
Mon Aug 02, 2004 1:43 pm
Forum: Volume 6 (600-699)
Topic: 657 - The die is cast
Replies: 46
Views: 22030

### 657 The die is cast WA

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 o...
Wed Jul 21, 2004 2:38 am
Forum: Volume 101 (10100-10199)
Topic: 10150 - Doublets
Replies: 46
Views: 17385
Hi, I doubt your solution to the case when the first string = second string. I sent a code that yields for the test case abc abc abc an answer abc So I guess this case doesn't exist. Also, does anybody know how to do this in C++? I tried to use sets/maps which supposingly uses binary search but it w...
Tue Jul 20, 2004 12:58 am
Forum: Volume 100 (10000-10099)
Topic: 10075 - Airlines
Replies: 9
Views: 5010
When calculating distance, round the distance to integer for every edge BEFORE adding them. For example, CityA -> CityB, 12.3km CityB -> CityC, 7.4km Then CityA -> CityC will be round(12.3) + round(7.4) = 12+7 = 19, and NOT round(12.3+7.4) = round(19.7) = 20 This would just mean that you should chan...
Sun Jul 18, 2004 3:10 pm
Forum: Volume 101 (10100-10199)
Topic: 10180 - Rope Crisis in Ropeland!
Replies: 39
Views: 21918
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 should...
Wed Jul 14, 2004 2:28 pm
Forum: Volume 5 (500-599)
Topic: 523 - Minimum Transport Cost
Replies: 44
Views: 10215
Hi,

getpath function should be

Code: Select all

``````void getpath(int r,int c)
{
int k;
k=path[r][c];
if(k!=-1)
{
getpath(r,k);
printf("%d-->",k);
getpath(k,c);
}
}``````
The print goes between the two recursive calls, as 'k' is the itermediate node between 'r' and 'c'.

Frank
Tue Jul 13, 2004 11:37 am
Forum: Volume 1 (100-199)
Topic: 109 - SCUD Busters
Replies: 96
Views: 25527
Sorry, I have found a bug in my convex hull code. I now got AC. Thanks for your help.

Frank