ps2 p3: trying to make a program that finds a solution to a Diophantine equation. http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/assignments/pset2.pdf
does it work?? what about the twenty packs?
Ok, I added a loop to look for twenty packs http://dpaste.com/hold/813333/ jat_989 has the right idea, but for some reason his solve function messes up unless you cast x as an int in the search loops. The upper bound that we are searching is every combination of 6, 9, and 20 packs less than N. This has a very heavy run-time for large N (i.e. N more than 100) Do you'all think it would be possible to try to limit the search to ceil(Npack)/packSize?
Join our real-time social learning platform and learn together with your friends!