Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 13 Online
OpenStudy (anonymous):

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

OpenStudy (anonymous):

heres my current script: http://www.pastebucket.com/4021

OpenStudy (anonymous):

does it work?? what about the twenty packs?

OpenStudy (anonymous):

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?

OpenStudy (anonymous):

http://c2.com/cgi/wiki?PrematureOptimization

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
3 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!