so how did you guys do on this years CCC?
Author |
Message |
zylum

|
Posted: Thu Feb 26, 2004 5:19 pm Post subject: (No subject) |
|
|
i still dont see why my program doesnt work... can someone plz explain where it goes wrong?? (S4)
-zylum |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
nis
|
Posted: Thu Feb 26, 2004 5:20 pm Post subject: (No subject) |
|
|
I did the senior contest and answered 1 2 3 and 4. for 5 i ran out of time and jsut ended up getting how ever many inputs were needed for the sample input and just putting to the screen the answer to the sample out put. hopfully i will get a couple marks for that. |
|
|
|
|
 |
limited_skillz
|
Posted: Thu Feb 26, 2004 6:11 pm Post subject: (No subject) |
|
|
did anyone finish j5?
ive been losing sleep over it , im takin gr 12 (im in 11) and i know recursion in and out, but i really dont understand how to do it |
|
|
|
|
 |
bugzpodder

|
Posted: Thu Feb 26, 2004 7:26 pm Post subject: (No subject) |
|
|
zylum wrote: i still dont see why my program doesnt work... can someone plz explain where it goes wrong?? (S4)
-zylum
you assumed the shortest distance is going to lie on a lattice point. not necessarily true. actually i think a nice way to approach this is that for segment AB, check A', B', two points that are really close to A, B. if distance is strictly decreasing/increasing then you could just take the shorter distance at A or B. otherwise just use the point to a line distance formula which is CA X AB / |AB|
of course the orientations much be maintained also |
|
|
|
|
 |
bugzpodder

|
Posted: Thu Feb 26, 2004 7:28 pm Post subject: (No subject) |
|
|
azndragon wrote: This topic is very depressing for me. I always did good in Computer Science, and I considered myself to be pretty good. However, our teacher did not adequately prepare us, and the best programmer in our school only managed to finish 3 questions, while I finished 2. I need to work on my logic more 
you arent the only one who are depressed... but generally speaking everyone did pretty badly  |
|
|
|
|
 |
Tony

|
|
|
|
 |
gvc
|
Posted: Thu Feb 26, 2004 8:45 pm Post subject: (No subject) |
|
|
bugzpodder wrote: zylum wrote: i still dont see why my program doesnt work... can someone plz explain where it goes wrong?? (S4)
-zylum
you assumed the shortest distance is going to lie on a lattice point. not necessarily true. actually i think a nice way to approach this is that for segment AB, check A', B', two points that are really close to A, B. if distance is strictly decreasing/increasing then you could just take the shorter distance at A or B. otherwise just use the point to a line distance formula which is CA X AB / |AB|
of course the orientations much be maintained also
Bugs,
This is one of the unfortunate cases in which you were disadvantaged by thinking too much. Because the planet is on a grid location, and the turtle travels from grid location to grid location on straight lines, the closest point will always be when the turtle is at a grid location. So all you have to do is move one unit at a time and check the distance after each move.
If the planet were located at an arbitrary place, or if the turtle could travel on the diagonal, you would have to do the geometry you suggest. |
|
|
|
|
 |
Andy
|
Posted: Thu Feb 26, 2004 9:28 pm Post subject: (No subject) |
|
|
ya see he didnt take gr 10 |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Brightguy

|
|
|
|
 |
Tony

|
Posted: Thu Feb 26, 2004 11:32 pm Post subject: (No subject) |
|
|
lol Well before they used to have those J3/S1, J4/S2, J5/S3 questions... where you basically do the common 3 and deside if you wanna pretend to be a junior and go for the highscore with first two easy questions, or play with the rest on the "senior" playfield... this year apparently it was not the case no common questions  |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
amvbse
|
Posted: Thu Feb 26, 2004 11:34 pm Post subject: (No subject) |
|
|
azndragon wrote: This topic is very depressing for me. I always did good in Computer Science, and I considered myself to be pretty good. However, our teacher did not adequately prepare us, and the best programmer in our school only managed to finish 3 questions, while I finished 2. I need to work on my logic more 
I know exactly what you mean. We weren't even taught recursion in gr12 (finished it 1st semester) by our teacher who I doubt even knows what it is. I definetaly need to hang around here more and pick up on things. |
|
|
|
|
 |
bugzpodder

|
Posted: Fri Feb 27, 2004 7:38 am Post subject: (No subject) |
|
|
tony wrote: limited_skillz wrote: did anyone finish j5?
im takin gr 12 (im in 11)
what's going on?  I though junior contest had a restriction that allows you to write it just once and only if you have no more then 1 CS credit  ... 
i guess i should have taken the junior  |
|
|
|
|
 |
bugzpodder

|
Posted: Fri Feb 27, 2004 7:43 am Post subject: (No subject) |
|
|
gvc wrote: bugzpodder wrote: zylum wrote: i still dont see why my program doesnt work... can someone plz explain where it goes wrong?? (S4)
-zylum
you assumed the shortest distance is going to lie on a lattice point. not necessarily true. actually i think a nice way to approach this is that for segment AB, check A', B', two points that are really close to A, B. if distance is strictly decreasing/increasing then you could just take the shorter distance at A or B. otherwise just use the point to a line distance formula which is CA X AB / |AB|
of course the orientations much be maintained also
Bugs,
This is one of the unfortunate cases in which you were disadvantaged by thinking too much. Because the planet is on a grid location, and the turtle travels from grid location to grid location on straight lines, the closest point will always be when the turtle is at a grid location. So all you have to do is move one unit at a time and check the distance after each move.
If the planet were located at an arbitrary place, or if the turtle could travel on the diagonal, you would have to do the geometry you suggest.
yeah you are right... i withdraw my previous comments... new to compsci.ca?? you would be?? |
|
|
|
|
 |
zylum

|
Posted: Fri Feb 27, 2004 12:55 pm Post subject: (No subject) |
|
|
well of course if the planet is located on integers and you only move onto integers, the closest point will be an integer... so whats wrong with my program?? |
|
|
|
|
 |
bugzpodder

|
Posted: Fri Feb 27, 2004 3:49 pm Post subject: (No subject) |
|
|
zylum wrote: well of course if the planet is located on integers and you only move onto integers, the closest point will be an integer... so whats wrong with my program??
then probably your orientation then |
|
|
|
|
 |
|
|