Computer Science Canada Dwite round 2 problem 3 |
Author: | MagicIdiot [ Thu Nov 25, 2010 12:36 am ] | ||
Post subject: | Dwite round 2 problem 3 | ||
Aww I got 4/5 on it. For the last test case, input: ......6. .6.....3 ...#4.75 7......2 ..9..... .....53. .8.6.... 4..5.9.. -------- My output: 33 (correct answer is 41) In Java:
(How do I make it highlight syntax?) |
Author: | A.J [ Thu Nov 25, 2010 12:44 am ] |
Post subject: | Re: Dwite round 2 problem 3 |
Well, since you didn't ask any question as such, I can only assume you are wondering why the answer is 41. The following path yields 41 (one of two paths, I believe): ......6# .6.....# ...#4.## 7.....#2 ..9...#. .....##. .#####.. ##.5.9.. 4 + 8 + 6 + 5 + 3 + 7 + 5 + 3 = 41 |
Author: | MagicIdiot [ Thu Nov 25, 2010 7:43 am ] |
Post subject: | Re: Dwite round 2 problem 3 |
Whoops, I was in a rush and forgot to ask, what am I missing or doing wrong in my code? |
Author: | A.J [ Thu Nov 25, 2010 4:18 pm ] |
Post subject: | RE:Dwite round 2 problem 3 |
When it comes to debugging code, the person who coded up the program has a the best chance of catching the mistake, as only they know everything that is going on in their code. Having said that, the error would have occurred anywhere. Try debugging it yourself (since you already know what testcase it is failing, try looking at all the intermediate steps). I can`t run it for you at home and figure out what it is doing as I don`t have a Java compiler, nor do I have the time (sorry). |