Showing posts with label Practice. Show all posts
Showing posts with label Practice. Show all posts

Monday, July 29, 2013

HR Red John is back

https://www.hackerrank.com/contests/101july13/challenges/red-john-is-back

Easy solution with the little dp and prime with very mild constraints




Friday, July 26, 2013

UVA10539 Almost Prime Numbers

Another easy one for prime number. Here u have to deal with the figures
after getting all primes just brute force . the no will be not large so u can afford it.
the exponential function grows very fast therefore no of almost prime are less(within computation limits)


UVA543 Goldbach's Conjecture

It is easy problem related to prime number
use sieve of erotheses

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