Search found 5 matches

by Fixxxer
Tue Apr 04, 2006 11:05 pm
Forum: Volume 110 (11000-11099)
Topic: 11003 - Boxes
Replies: 29
Views: 21609

Consider following case

5
2 10
2 10
2 21
20 1
1 2

output should be 4

anyway i used memoization but got TLE :wink:
can anyone give any hint
by Fixxxer
Mon Feb 06, 2006 7:54 pm
Forum: Volume 103 (10300-10399)
Topic: 10373 - The Brick Stops Here
Replies: 1
Views: 1717

This can be solved using 0/1 knapsack

use a table Tab[C][B] where
B is no of bricks and
C is total copper content (not concentration) in B bricks

Tab[C][B] contains minimum price of purchasing B bricks where total copper content in B bricks is C

MAX_B=20
MAX_C=1000*20

hope this helps
by Fixxxer
Sat Oct 15, 2005 11:03 pm
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 62450

My AC code says "2 2 1" is not an A sequence :o
by Fixxxer
Thu Oct 13, 2005 12:18 pm
Forum: Algorithms
Topic: Anagram
Replies: 7
Views: 3188

try STL next_permutation
by Fixxxer
Tue Oct 11, 2005 11:03 pm
Forum: Algorithms
Topic: Min-Max Search
Replies: 7
Views: 2292

Isnt it a usaco problem?
i solved it using memoization

max_profit(i,j)=MAX((a[i]+sum[i+1][j]-max_profit(i+1,j)),(a[j]+sum[i][j-1]-max_profit(i,j-1)))

Go to advanced search