Showing posts with label Problem Collection. Show all posts
Showing posts with label Problem Collection. Show all posts

Tuesday, July 23, 2013

DP practice problems



Chest of Drawer Practice DP


Chest of Drawers - Problem D of ACM World Finals Warmup
2008
You are given a chest of drawers with N drawers, which
can be locked.
You want to have exactly S secured drawers.
But not all locked drawers are secure.
A locked drawer is secure:
If it’s either the top drawer.
If the drawer directly above it is locked aswell.
Constraints:
0 <= N <= 65
0 <= S <= 65
You have to count how many ways you can locked N
drawers to give you S secure drawers.

I will publish answe later


Try this POJ 2663