Computer Science Canada Jan dwite 2009 Q5 |
Author: | DanielG [ Sat Jan 17, 2009 6:35 pm ] |
Post subject: | Jan dwite 2009 Q5 |
did anyone other then me not use BFS/DFS and still get 5/5 on question 5? |
Author: | saltpro15 [ Sat Jan 17, 2009 7:16 pm ] |
Post subject: | RE:Jan dwite 2009 Q5 |
we used BFS and got 0/5 ![]() |
Author: | A.J [ Sat Jan 17, 2009 7:29 pm ] |
Post subject: | Re: Jan dwite 2009 Q5 |
what is your team name saltpro? cuz we used BFS and got 5/5 (we were 8th place) |
Author: | saltpro15 [ Sat Jan 17, 2009 8:18 pm ] |
Post subject: | RE:Jan dwite 2009 Q5 |
my team was the awesome swatcats, we were 36th, probably would have been 20 something if we got Q5 |
Author: | saltpro15 [ Sat Jan 17, 2009 8:48 pm ] | ||
Post subject: | Re: Jan dwite 2009 Q5 | ||
someone want to tell me why this is a 0/5 ? not complaining, I just want to know what to change for next time |
Author: | DanielG [ Sat Jan 17, 2009 9:45 pm ] |
Post subject: | RE:Jan dwite 2009 Q5 |
I personally find the non recursive (using a while loop/[just loop in turing]) approach to be easier and to work better for BFS, just look at your recursive function, you are calling the function only after the previous has completely finished. flexibles arrays are bad (especially in turing), but that's another matter. About your current code, I noticed that you only get lay before your 5 runs, which would cause your program to (assuming everything else worked) only work for the first test case. Other than that I can't see immediately what was wrong with your code, try looking at other's code and seeing what is different (don't try mine, as I used a completely different method) |
Author: | Dan [ Sat Jan 17, 2009 10:44 pm ] |
Post subject: | RE:Jan dwite 2009 Q5 |
I am a bit behind in looking in to complaints about cases where the judge may have screwed up. However remeber that there is a set time limit for how long the code is allowed to run for. Also rember that the judge changes the order of the test cases in the file, the one shown on the site is just an example so try testing your code with the test cases in a diffrent order as well. |
Author: | A.J [ Sun Jan 18, 2009 12:01 am ] |
Post subject: | Re: Jan dwite 2009 Q5 |
hey saltpro compare your BFS code for 4 and 5 with mine (as it is almost identical surprisingly) though i do agree with DanielG......the 'manual' BFS method is better in turing , and also a bit easier to understand (and perhaps to code also) making it ideal to use |
Author: | DanielG [ Sun Jan 18, 2009 12:37 am ] |
Post subject: | RE:Jan dwite 2009 Q5 |
I just realized the easiest way to do this question (that is at the same time efficient, and I don't think anyone did). All you need is floodfill, since if you can reach a place, it's distance would be the frame number (-1 if you start from 1). |
Author: | saltpro15 [ Sun Jan 18, 2009 8:41 am ] |
Post subject: | RE:Jan dwite 2009 Q5 |
lol AJ, I see what you mean about the code being similar ![]() |