Search found 5 matches

by uzurpatorul
Fri Feb 18, 2005 10:09 am
Forum: Volume 108 (10800-10899)
Topic: 10817 - Headmaster's Headache
Replies: 25
Views: 15792

in 4 3 10 1000 1 2 1000 3 1000 1 5000 1 2 3 4 50000 3 50000 4 50000 3 4 50000 1 50000 1 50000 2 50000 1 50000 2 50000 1 8 4 20 1000 1 1000 2 1000 3 1000 2 10000 1 20000 2 40000 3 4 50000 1 2 50000 1 4 50000 1 50000 1 3 4 50000 1 2 3 4 50000 1 3 4 50000 1 2 3 4 50000 1 3 4 50000 1 5 7 3 4 50000 1 2 3...
by uzurpatorul
Thu Feb 17, 2005 10:19 am
Forum: Volume 108 (10800-10899)
Topic: 10817 - Headmaster's Headache
Replies: 25
Views: 15792

Out of my curiosity what is the idea behind using memoizetion?, I used dynamic programming and my solution is very similar with the classic 0-1 knapsack problem, the only difference is that I have an array of subjects instead of the weight.

Cheers,
R.
by uzurpatorul
Tue Nov 09, 2004 12:34 pm
Forum: Volume 105 (10500-10599)
Topic: 10502 - Counting Rectangles
Replies: 24
Views: 11799

test cases .... right/wrong

Could someone tell me if any of my test cases is wrong ?, is there any tricky test case ? Regards, R. 2 2 11 01 4 3 110 101 111 011 1 1 1 1 1 0 3 4 1111 1001 1001 4 4 1111 1111 1001 1001 3 3 111 111 111 4 4 1111 1111 1111 1111 5 5 11111 11111 11111 11111 11111 3 3 111 101 111 6 6 111111 100001 10000...
by uzurpatorul
Tue Oct 26, 2004 1:05 am
Forum: Volume 106 (10600-10699)
Topic: 10643 - Facing Problem With Trees
Replies: 10
Views: 5494

The formula is 1/2 * (m!)/((m/2)!*(m/2)!),
http://www.cs.brandeis.edu/~ira/papers/superballot.pdf
by uzurpatorul
Fri Oct 22, 2004 8:01 pm
Forum: Volume 107 (10700-10799)
Topic: 10702 - Travelling Salesman
Replies: 20
Views: 9197

use dynamic programming and store the max value per step, the algo to find the max is: int findMax(int c, int s, int e, int t, int step) { if (step == t) { for (i = 0; i < e; i++) Max(cost[s][endcity - 1]) } else for (j = 0; j < c; j++) { Max(cost[s][j]+ findMax(c, j, e, t, step + 1)); } return max; }

Go to advanced search