Computer Science Canada Critique my solution please. |
Author: | Cinjection [ Sat Feb 23, 2008 4:29 pm ] | ||
Post subject: | Critique my solution please. | ||
Hey guys. In my quest to learn dynamic programming techniques, I've solved the S4 problem from the 2007 CCC. To my great pleasure, my solution seems to work and is fast. I'm happy with it, but I'm wondering if I'm doing something wrong. I'd appreciate if someone could look over my C++ solution and tell me if I'm doing something wrong or not doing something right. Here's a link to the question: http://cemc.uwaterloo.ca/ccc/2007/seniorEn.pdf My C++ solution is below:
Please critique my code any way you can, as it will help me for next time. Thanks in advance. |
Author: | md [ Sat Feb 23, 2008 7:00 pm ] |
Post subject: | RE:Critique my solution please. |
Your solution is short and ugly! It also dresses poorly! Actually I'm insanely far behind on some work; but a cursory glance seems to show it's good. Got some problem files we can test it with too? |
Author: | wtd [ Sun Feb 24, 2008 12:19 am ] | ||||
Post subject: | RE:Critique my solution please. | ||||
Quick one:
|
Author: | Cinjection [ Sun Feb 24, 2008 12:49 pm ] |
Post subject: | Re: RE:Critique my solution please. |
md @ Sat Feb 23, 2008 7:00 pm wrote: Your solution is short and ugly! It also dresses poorly!
Actually I'm insanely far behind on some work; but a cursory glance seems to show it's good. Got some problem files we can it with too? Thanks. I tested it with the test cases that CCC used, and it worked with all five. |
Author: | cyberfish [ Wed Mar 19, 2008 5:32 pm ] |
Post subject: | RE:Critique my solution please. |
Don't know about the coding, but the algorithm is exactly the same as the one I submitted. http://access.mmhs.ca/ccc/2007/CCC2007S4WaterparkRecursion.txt |
Author: | A.J [ Wed Mar 19, 2008 5:56 pm ] |
Post subject: | Re: Critique my solution please. |
I had a MUCH faster method by recording the values (memoization) + DP |