Search found 5 matches

by cmad
Mon Jul 24, 2006 2:24 pm
Forum: Volume 110 (11000-11099)
Topic: 11055 - Homogeneous squares
Replies: 16
Views: 9485

No it's exactly the same... Your solution holds holds the width and height fixed, whereas the other solution holds the coordinates of the top-left cell fixed. Exactly the same thing, different approach.
by cmad
Sun Jul 23, 2006 4:31 pm
Forum: Volume 110 (11000-11099)
Topic: 11054 - Wine trading in Gergovia
Replies: 25
Views: 11041

It's greedy. (i.e. O(N))
by cmad
Fri Sep 02, 2005 12:31 pm
Forum: Volume 104 (10400-10499)
Topic: 10482 - The Candyman Can
Replies: 10
Views: 7551

Yes it seems to be able to handle (1, 2, 3) cases correctly. I'll pm you my e-mail as you said.
by cmad
Fri Sep 02, 2005 11:53 am
Forum: Volume 104 (10400-10499)
Topic: 10482 - The Candyman Can
Replies: 10
Views: 7551

I must be very unlucky, as I compared my program with a bruteforce implementation of the solution (3^n). I ran 100 random tests, perfect matches for each test (n = 13 for each test, otherwise the bf binary would take ages to finish). This is weird :\ And I don't think it's an off-by-one error in ...
by cmad
Thu Sep 01, 2005 10:24 am
Forum: Volume 104 (10400-10499)
Topic: 10482 - The Candyman Can
Replies: 10
Views: 7551

10482 - The candyman can

I was wondering if someone could point out the error in my DP algorithm (I get WA):

let sum(n) be the sum of the candies #1..n of the input

let c(n, a, b) be the min difference (as defined in the problem) of the total candy weight of the 3 children, right before candy #n is given, at that point ...

Go to advanced search