
-----------------------------------
zylum
Tue Feb 24, 2004 4:31 pm

so how did you guys do on this years CCC?
-----------------------------------
just wondering how everyone did... i only finished the first 4 questions :(

-zylum

-----------------------------------
Asok
Tue Feb 24, 2004 5:48 pm


-----------------------------------
The Senior this year seemed to have a lot more "confusing wording" than last year. Those Waterloo asshats!  :x

-----------------------------------
zylum
Tue Feb 24, 2004 5:49 pm


-----------------------------------
so how did you do???

-----------------------------------
limited_skillz
Tue Feb 24, 2004 5:53 pm


-----------------------------------
i did the first four pretty easily, but i think somethings wrong with my fourth one (im a junior)

occasionaly i would get an odd character in my encoding message like "&#9788;" or something

the last one was impossible, i started with an hour left.. asked 3 teachers, they couldnt help much, brought in a genius to do it, it took a while but they finally got it and explained it to me

its definately not right, but i put some code down

i dont think any gr. 11 could get that, they deserve to win if they could

-----------------------------------
zylum
Tue Feb 24, 2004 6:11 pm


-----------------------------------
you're allowed to ask for help from ppl???

is the junior last one the spread sheet one???

-----------------------------------
nate
Tue Feb 24, 2004 7:22 pm


-----------------------------------
For junior the first 3 were so simple, the 4th one took about 20min, and i by the time i understood the crappy wording of J5 there wasn't enough time left to actually do it. 

And how can u get help from another person (isn't there sapposed to be no talkin?)

-----------------------------------
Mazer
Tue Feb 24, 2004 7:49 pm


-----------------------------------
Supposedly you aren't supposed to be talking, like an exam or a math contest, but some of the students were having little conversations about the contest while writing. Nothing like giving each other hints or anything, just stuff like "why the hell do we have to take input from the keyboard this year?!" or "yay, my recursion is working" or "wouldn't that suck if nobody made it to stage 2? We'd be so pissed off... well, not you, you've got your recursion to keep you happy."

But seriously, why did they switch to keyboard input only all of the sudden? I didn't even know about it until half way through the contest, were they expecting me to read the rules?

-----------------------------------
Tony
Tue Feb 24, 2004 7:50 pm


-----------------------------------
bah, senior was insane :? I'm guessing they got new staff to make it cuz the contest has a compleatly different feel to it. And this year Juniors/Seniors had no questions incommon :? 

Anyways, I finished S1, S2 and S5. S4 I didnt even start (seemed too confusing from the beginning) and S3 was really buggy when I ran out of time :roll:

as for input - I was wondering out that too... and for S5 I said - screw it, I'm not retyping the damn maze map every time and just made it load from a datafile... if anyone complains - screw you. The contest was hard enough as it is

-----------------------------------
Brightguy
Tue Feb 24, 2004 8:30 pm

Re: so how did you guys do on this years CCC?
-----------------------------------
Well, this was my first year writing the contest (I didn't even know about it last year). All my solutions were written in Visual Basic. 

Overall I enjoyed it and thought some of the questions were really challenging. I would have liked to finish all the questions, but unfortunately I ran out of time. (Most of my time was spent on the spreadsheet question.) I managed to finish S1, S2, and S3. Now I'm just hoping there aren't any bugs in them... 

By the way, I thought there were supposed to be three middle problems common to both the junior and senior division? (On that sheet where you filled out your name it had the problems listed as J3S1, J4S2, J5S3.) Anyway, once I finished the first three seniors I thought "I don't have enough time to complete the final two senior problems (I had less than an hour remaining), but I could do the first two juniors and at least have a really good junior score." So I completed the first two juniors easily... but it turns out the problems don't overlap. So I did enter the senior division after all, but only with the first three problems done. 

Question... If you just made a program that just outputs "0", would you still get points if a test case happened to have a 0 output? Very cheap...

-----------------------------------
TheZsterBunny
Tue Feb 24, 2004 8:40 pm


-----------------------------------
This was my first CCC. I took the junior one this year. I'm wondering if they set the questions up in the order on purpose. I finished questions j1,j2,j3 in the first 15 minutes. I then took 2 hours on j4 and had no idea about j5. if anyone knows how to do it, please reply.

I tried using whatdotcolor, and it helped quite a bit  :lol: , however I lacked the math background to do the question.

*sigh*

-bunny

-----

but seriously, none of the programs needed more than 40 lines of code.

I think i did j4 in 26 lines. I can't remember.

but j1 was pretty much this (this is not cut and paste, it is typed here, excuse errors please)


var ino : int % input number
loop
put "Enter a number: "..
get ino
put "The Largest square you can make is ", floor (sqrt(ino)),"."
end loop


J5 used fractals.

-----------------------------------
Brightguy
Tue Feb 24, 2004 8:44 pm

Re: so how did you guys do on this years CCC?
-----------------------------------
But seriously, why did they switch to keyboard input only all of the sudden? I didn't even know about it until half way through the contest, were they expecting me to read the rules?
Huh...  Did I read something wrong?  It looked to me like most of the questions were expecting input from a data file.  I thought only J1 and J2 wanted keyboard input (they had the title "Sample Session" instead of "Sample Input").

On the advice sheet I got, it says:
5. For each problem where input is required, the structure of the data file is explained in the description of the problem and a sample data file is printed on the problem sheet, together with the expected output.

-----------------------------------
Chimaera
Tue Feb 24, 2004 8:48 pm


-----------------------------------
so I guess it wasn't only me and my friends who felt stupid writing the questions, the questions were TOTALLY different from previous years. 

damnit! I wish i knew how to do my sorting perfectly so I could get full marks on the s2 which was the yodeller one and s1 which was the 'fix' one  :x 

I actually found S4 the easiest one of them all, I finished that one last and I didn't even bother with S5, it's too damn complicated to truncate the whole line of input and then slowly sort through it one by one and make sure that the whole thing is aligned to the right grids....I suppose it'd be much easier doing that one using a Visual language ie. VB but I'm not too familiar with it... :roll: 

sigh....I just hope I scored fairly well letalone go onto stage 2....btw does Massey send people to stage 2 every year?

-----------------------------------
Andy
Tue Feb 24, 2004 8:54 pm


-----------------------------------
lol azn_s finished the junior 1-4 in ten min, i swear, i sat beside him, then he had 2 hrs and 50min for j5 and he couldnt do it... should've just hard coded it with a million ifs

-----------------------------------
StrikerMagazine
Tue Feb 24, 2004 9:46 pm


-----------------------------------
Eh.. i wrote senior but probably didn't do very well. i did s1, s2, s3 (works mostly) and s4.. (uh..) i couldn't think of any other way to do s4 at the time except break it into cases. (i pretty much ran out of time doing the cases.. there's so many...) i was surprised by the keyboard input thing too. None of the practice sheets were like this... i ended up using a datafile and then changing it to keyboard later. i wonder if the poor person marking it has to type all that out (it must be marked some other way?)
the questions themselves this year seemed a different style from the ones in previous years (or maybe it's just me..) i did a good number of ?s from previous contests for practice but now that i think of it maybe it didn't help so much(..!)
.. i'm just so glad it's over (..!)

-----------------------------------
limited_skillz
Tue Feb 24, 2004 9:53 pm


-----------------------------------
i think i messed up on j4 to think about it

this is what i did

made an array of the alphabet 1..26
fed the letter in through ascii

made the key an array which matched up same letters with the alphabet array and put them according to i 


i dont know how i did the part where it is suppose to be in columns, thats why i think i messed up

-----------------------------------
Chimaera
Tue Feb 24, 2004 9:54 pm


-----------------------------------
wow....i really don't understand how some people had such a hard time with S4, S4 was really easy. There were 3 things to do, declare the 7 variables, they even gave em to you, sx, sz, sy and tx,ty,ty and distance between your current position and the desired destination. The last variable, you had to figure out yourself the distance formula for. Then you would get the values for sx, sz, sy, tx, tz, ty from user. After getting the values, then you would loop a get for 2 things, an integer value for the distance travelled and the string value for Up, Down, Left, Right. Then depending on whether it was left/right, up/down, you add or subtract to the tx, tz, ty variables, also add in the elsif condition of invalid input. I just followed the input format of the sample input and output format of sample output. The hardest part about the whole problem was the distance formula. Probably the 1st or 2nd most straight forward problem there was in the whole senior problem set. But S1, whoooo.....now that's a question I totally didn't understand.

-----------------------------------
Andy
Tue Feb 24, 2004 10:01 pm


-----------------------------------
wow... s4 is not easy, u dont even understand how the question works... its not lattice points...

-----------------------------------
Tony
Tue Feb 24, 2004 10:03 pm


-----------------------------------
StrikerMagazine - the questions did have a new style to them, its not just you :roll: 

and damn... I should have probably been working on S4 instead of S3 :? 

Chimaera - S1's really confusing... well, the way they ask it... I was just sitting there for the first like 5 minutes of the contest going "wtf? am I high? how come I'm not getting the first question??"

solution is simple though - just check if all 3 words have the same first or last letter :lol:

-----------------------------------
Chimaera
Tue Feb 24, 2004 10:08 pm


-----------------------------------
w/e dodge, how is it NOT lattice points? It was a 3d system where there was an x, y, z coordinates. Explain yourself when you say that, instead of just saying that I'm wrong.

ps. ty tony for clearing S1 for me, I would never have thought of it that way, props for figuring it out. In terms of difficulty, I'd probably have to say S5 was the toughest one of them all, but to each his own.

-----------------------------------
AsianSensation
Tue Feb 24, 2004 11:15 pm


-----------------------------------
actually dodge, I finished J1 - 4 in 7 minutes, lol, mis-reported my time by 3 whole minutes.

anyways, I was trying forever for J5, took me at least 30 something minutes to understand what it's asking for. Then I was like, hey wouldn't this be fun if I used whatdotcolor? Of course, I sat next to dodge, so he was like Do it! Do it! So I tried with whatdotcolor, except abstract whatdotcolor, I made my own drawfill functions, abstract whatdotcolor functions and everything. As you could see, it didn't work.So then I went back and started over. So there is still 2 hours something left, I forgot about the orientation of the boxes and stuff, so I went back and did that. took some time, blah blah blah, brain got jumbled up, starts to hardcode with 1 hour left. Should have just hardcoded it from the beginning.

-----------------------------------
Brightguy
Tue Feb 24, 2004 11:33 pm

Re: so how did you guys do on this years CCC?
-----------------------------------
solution is simple though - just check if all 3 words have the same first or last letter :lol:
Tony, I'm not sure I understand this - is it really that easy?  You're saying that if all three words have the same first or last letter, then the collection of words is not fix-free (i.e. one word is the prefix/suffix of another word)?

But even if both the first and last letters of all three words are the same, that doesn't necessarily mean that one word is the prefix/suffix of another word.  For example, take the collection of words:

aba
abba
abbba

Each word has the same first and last letter, but no word is the prefix/suffix of another word.  Thus, the collection of words is fix-free.

-----------------------------------
nate
Tue Feb 24, 2004 11:34 pm


-----------------------------------
For the J5 question it was a bitch i had over 1.5 hours remaining and i spent most of that time understanding it like Asn_S. I still don't really understand this part




*********
*********
*********
*********
*********
*********
*********
*********
*********

turns to 

              ***
              ***
              ***
           *********
           *********
           *********
        ***************
        ***************
        ***************
     ***   *********   ***
     ***   *********   ***
     ***   *********   ***   score (winner) then
        winner := i
    end if
end for

cls
for i : 1 .. yodlers
    if score (i) = score (winner) then
        put "Yodler ", i, " is the top Yodeller: score ", score (i), ", worst rank ", rank (i)
    end if
end for


-----------------------------------
TheZsterBunny
Wed Feb 25, 2004 6:02 pm


-----------------------------------
Don't kill yourselves over 3 or 5 lines. Understandably, this is frustrating, but you may only lose one point over it. 

The Junior questions were very simple, with the exception of question number 5. This required recursion, a topic with which most grade 10 or 11's are unfamiliar with. 

If anyone has a working solution for J5, I'm sure that many people would want to see it. (+Bits)

I hate bribes, but sometimes...

-bunny

-----------------------------------
nelson
Wed Feb 25, 2004 6:03 pm


-----------------------------------
hello, this is wut i did for s2
i not gonna show u how i fucked up the worst rank,,, 


var n, k : int

put "Enter number of contestents: "
get n
put "Enter the number of rounds: "
get k


var input : array 1 .. k, 1 .. n of int


for i : 1 .. k
    put "input scores for round ", i
    for j : 1 .. n
        get input (i, j)
    end for
end for

var score : array 1 .. n of int
var con : array 1 .. n of int

for i : 1 .. n
    score (i) := 0
    con (i) := i
end for


var rank : array 1 .. n of int

for i : 1 .. k
    for j : 1 .. n
        score (j) := score (j) + input (i, j)
    end for
end for

var temp1, temp2, temp3, temp4 : int

for i : 1 .. n - 1
    for j : i + 1 .. n
        if score (j) > score (i) then
            temp1 := score (i)
            score (i) := score (j)
            score (j) := temp1

            temp2 := con (i)
            con (i) := con (j)
            con (j) := temp2
        end if
    end for
end for

var c : int := 1
var high : int




high := score (1)



for i : 2 .. n
    if score (1) = score (i) then
        c := c + 1
    end if
end for



for i : 1 .. c - 1
    for j : i + 1 .. c
        if con (j) < con (i) then
            temp2 := con (i)
            con (i) := con (j)
            con (j) := temp2
            temp1 := score (i)
            score (i) := score (j)
            score (j) := temp1
        end if
    end for
end for


var l : int
l := n




????????????????
??????????????
?????????????????                worst rank conding,,,, stupidity
???????????????
????????????






put " "
if n < 2 then
    put "YODELLR ", con (1), " is the Top Yodeller: score ", score (1)

else
    for i : 1 .. c
        put "YODELLR ", con (i), " is the Top Yodeller: score ", score (i), " worst rank ", l + 1
    end for
end if


-----------------------------------
nelson
Wed Feb 25, 2004 6:04 pm


-----------------------------------
and s3, 

can someone comment on this plz?  ,,, other than datafile..




var spread : array 1 .. 10, 1 .. 9 of string
var ok : int
var num : array 1 .. 10, 1 .. 9 of string

var temp, temp2 : int
var oricol, orirow : int



for i : 1 .. 10
    for j : 1 .. 9
        num (i, j) := "*"
    end for
end for


put "INPUT A ROW"
for i : 1 .. 9
    get spread (1, i)
end for
put "INPUT B ROW"
for i : 1 .. 9
    get spread (2, i)
end for
put "INPUT C ROW"
for i : 1 .. 9
    get spread (3, i)
end for
put "INPUT D ROW"
for i : 1 .. 9
    get spread (4, i)
end for
put "INPUT E ROW"
for i : 1 .. 9
    get spread (5, i)
end for
put "INPUT F ROW"
for i : 1 .. 9
    get spread (6, i)
end for
put "INPUT G ROW"
for i : 1 .. 9
    get spread (7, i)
end for
put "INPUT H ROW"
for i : 1 .. 9
    get spread (8, i)
end for
put "INPUT I ROW"
for i : 1 .. 9
    get spread (9, i)
end for
put "INPUT J ROW"
for i : 1 .. 9
    get spread (10, i)
end for






var row : string
var rowint : int
var col : int
var temppp : int

proc switch2

    if row = "A" then
        rowint := 1
    end if
    if row = "B" then
        rowint := 2
    end if

    if row = "C" then
        rowint := 3
    end if

    if row = "D" then
        rowint := 4
    end if
    if row = "E" then
        rowint := 5
    end if

    if row = "F" then
        rowint := 6
    end if

    if row = "G" then
        rowint := 7
    end if

    if row = "H" then
        rowint := 8
    end if
    if row = "I" then
        rowint := 9
    end if
    if row = "J" then
        rowint := 10
    end if

    if num (rowint, col) = "*" then

    else
        if num (orirow, oricol) = "*" then
            num (orirow, oricol) := "0"
        end if

        temppp := strint (num (rowint, col)) + strint (num (orirow, oricol))
        num (orirow, oricol) := intstr (temppp)
        ok := 2
    end if

end switch2



proc switch
    if row = "A" then
        rowint := 1
    end if
    if row = "B" then
        rowint := 2
    end if

    if row = "C" then
        rowint := 3
    end if

    if row = "D" then
        rowint := 4
    end if
    if row = "E" then
        rowint := 5
    end if

    if row = "F" then
        rowint := 6
    end if

    if row = "G" then
        rowint := 7
    end if

    if row = "H" then
        rowint := 8
    end if
    if row = "I" then
        rowint := 9
    end if
    if row = "J" then
        rowint := 10
    end if

    if num (rowint, col) = "*" then
    else

        num (orirow, oricol) := num (rowint, col)

    end if


end switch



var tempr : string
% for pp : 1 .. 1000
ok := 1
for i : 1 .. 10
    for j : 1 .. 9
        if strintok (spread (i, j)) then
            num (i, j) := spread (i, j)

        elsif length (spread (i, j)) = 2 then
            tempr := num (i, j)
            row := spread (i, j) (1)
            col := strint (spread (i, j) (2))
            orirow := i
            oricol := j
            switch
            % if tempr = num (i, j) then
            %     ok := 2
            % end if
        else
            temp := 1
            tempr := num (i, j)
            for o : 1 .. floor (((length (spread (i, j))) - 1) / 2)
                temp2 := temp + 1
                row := spread (i, j) (temp)

                col := strint (spread (i, j) (temp2))
                orirow := i
                oricol := j
                switch2

                temp := temp + 3
            end for
        end if

    end for
end for



loop
    ok := 1
    for i : 1 .. 10
        for j : 1 .. 9

            if spread (i, j) = "*" then
                if strintok (spread (i, j)) then
                    num (i, j) := spread (i, j)

                elsif length (spread (i, j)) = 2 then
                    tempr := num (i, j)
                    row := spread (i, j) (1)
                    col := strint (spread (i, j) (2))
                    orirow := i
                    oricol := j
                    switch
                    if tempr = num (i, j) then
                    else
                        ok := 2
                    end if
                else
                    temp := 1
                    tempr := num (i, j)
                    for o : 1 .. floor (((length (spread (i, j))) - 1) / 2)
                        temp2 := temp + 1
                        row := spread (i, j) (temp)

                        col := strint (spread (i, j) (temp2))
                        orirow := i
                        oricol := j
                        switch2
                        if tempr = num (i, j) then
                        else
                            ok := 2
                        end if
                        temp := temp + 3
                    end for
                end if
            end if
        end for
    end for
    if ok = 1 then
        exit
    end if
end loop



for i : 1 .. 10
    for j : 1 .. 9
        put num (i, j), " " ..
    end for
    put " "
end for




-----------------------------------
bugzpodder
Wed Feb 25, 2004 6:11 pm


-----------------------------------
J5 wow dam they made it THAT hard that Asian_S cant even do??  I gotta see this one
S4 is definately NOT trivial... first of all, i think the ship has orientation, that means if you turn, the directions changes.  secondly its not latice points...  you are suppose to find the equation of a line that passes thrugh the planet that is perpendicular to the path travelled and check if the intersection is on the segment (path travelled).  if it is, find the distance, otherwise take the shorter distance of the end  points.  it requires some consider amount of 3D algebra (taught in grade 12)

I will post my solutions to the seniors (in C++) if anyone's interested, when i get access to them...  well the ones besides S4 which i am too lazy to code up.  ps they have a new marking scheme for partial marks so i might make stage 2 this year :D

-----------------------------------
Dan
Wed Feb 25, 2004 9:00 pm


-----------------------------------
i did the s level of the ccc this year. i was very disapointed in them. there questions made no logical sencen and cause me to do the question wrong. also i spent so much time trying to figger out what they are saying i did not even get to S4 and S5. now that i know what they ment i am reay pissed b/c it whould have not been that hard to do. oh well....

-----------------------------------
Asok
Wed Feb 25, 2004 11:37 pm


-----------------------------------
I agree with Dan, they really tried to hide what they wanted the program to do.

-----------------------------------
bugzpodder
Thu Feb 26, 2004 7:48 am


-----------------------------------
In all fairness, i would say that S1, S2, S3, S5 are very straight-foward (in terms of clarity of the problem statement), and S4 is pretty clear (of course, once you figure out whats going on -- with the sample test case as a hint) and very cleverly composed.

-----------------------------------
Andy
Thu Feb 26, 2004 10:56 am


-----------------------------------
nelson, ever heard of index?

-----------------------------------
SilverSprite
Thu Feb 26, 2004 12:06 pm


-----------------------------------
i think that s4 was not AS hard as bugz makes it out to be.. though still pretty tough 

the orientation is not hard. create a variable for each of the 3 axis and corresponding booleans. when you turn you just change the front of yoru ship to the side your turning to, and you logically invert the side your turning to. the third axis remains the same. 

as for the shortest distance. that is a little tougher. but doing it by hand would not be so hard if your knowledgable in algebra. which you should all be, if you do 3d programming.

the problem was not poorly worded, however, it was not easy to figure out that you needed to find teh shortest distance to the line.

-----------------------------------
zylum
Thu Feb 26, 2004 1:02 pm


-----------------------------------
for anyone who is interested, here is the answer to S4....


var file : int
var fileName : string := "s4.3.data"
open : file, fileName, get
var orient : array 1 .. 3 of int := init (1, 2, 3)
var coords : array - 3 .. 3 of int
var dist : real := 100000

var move : int
var dir : string
var tempDir : int

for i : -3 .. 3
    coords (i) := 0
end for

var tempCoords : int
for i : 1 .. 3
    get : file, tempCoords
    if tempCoords < 0 then
        coords (-i) := tempCoords
    else
        coords (i) := tempCoords
    end if
end for
var pDist : array 1 .. 3 of real
for i : 1 .. 3
    get : file, pDist (i)
end for
dir := "L"
var xd : real
var yd : real
var zd : real
var tempDist : real
loop
    exit when dir = "E"
    get : file, move
    get : file, dir
    for : 1 .. move
        coords (orient (1)) += 1
        for i : 1 .. 3
            coords (i) -= coords (-i)
        end for
        xd := pDist (1) - coords (1)
        yd := pDist (2) - coords (2)
        zd := pDist (3) - coords (3)
        tempDist := sqrt (abs (xd ** 2 + yd ** 2))
        tempDist := sqrt (abs (tempDist ** 2 + zd ** 2))
        if tempDist < dist then
            dist := tempDist
        end if
    end for
    if dir = "L" then
        tempDir := orient (2)
        orient (2) := -orient (1)
        orient (1) := tempDir
    end if
    if dir = "R" then
        tempDir := -orient (2)
        orient (2) := orient (1)
        orient (1) := tempDir
    end if
    if dir = "U" then
        tempDir := orient (3)
        orient (3) := -orient (1)
        orient (1) := tempDir
    end if
    if dir = "D" then
        tempDir := -orient (3)
        orient (3) := orient (1)
        orient (1) := tempDir
    end if
end loop

put dist : 0 : 2



-zylum

-----------------------------------
shorthair
Thu Feb 26, 2004 3:39 pm


-----------------------------------
Wow i went way to complex , i was no where near that , Gosh i think way to hard about these problems , Nice code by the way   , i understand that more than i understand the question  :D

-----------------------------------
bugzpodder
Thu Feb 26, 2004 4:24 pm


-----------------------------------
when its the shortest, it doesnt have to be integer coordinates

-----------------------------------
zylum
Thu Feb 26, 2004 4:26 pm


-----------------------------------
what do you mean bugz???

-----------------------------------
amvbse
Thu Feb 26, 2004 4:52 pm


-----------------------------------
The solution for S4 only works for the first 2 data inputs. Input 3, and 5 are relatively close, and 4 is off. Still a very nice job.

-----------------------------------
zylum
Thu Feb 26, 2004 5:01 pm


-----------------------------------
damn... i tested it on the first 2 and didnt think to test on the others... sorry for posting a faulty program...

-----------------------------------
azndragon
Thu Feb 26, 2004 5:03 pm


-----------------------------------
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 :(

-----------------------------------
zylum
Thu Feb 26, 2004 5:19 pm


-----------------------------------
i still dont see why my program doesnt work... can someone plz explain where it goes wrong?? (S4)

-zylum

-----------------------------------
nis
Thu Feb 26, 2004 5:20 pm


-----------------------------------
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
Thu Feb 26, 2004 6:11 pm


-----------------------------------
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
Thu Feb 26, 2004 7:26 pm


-----------------------------------
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
Thu Feb 26, 2004 7:28 pm


-----------------------------------
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
Thu Feb 26, 2004 8:39 pm


-----------------------------------
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 :? ... :think:

-----------------------------------
gvc
Thu Feb 26, 2004 8:45 pm


-----------------------------------
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
Thu Feb 26, 2004 9:28 pm


-----------------------------------
ya see he didnt take gr 10

-----------------------------------
Brightguy
Thu Feb 26, 2004 9:41 pm

Re: so how did you guys do on this years CCC?
-----------------------------------
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 :? ... :think:
My computer science teacher gave us both the junior and senior booklets and told us we could do either; he didn't mention any restrictions.

Apparently I slightly misunderstood S2.  When it said to output the worst rank, I thought it meant the rank of the worst yodeller, not the winner's worst rank.  :(  In the sample case when they explained the output they listed everyone's current rank, not their worst rank.  And it just so happened that the winner's worst rank overall was the same as the loser's final rank. :roll: 

So I lost 4 marks on that question.  And in S3, my program took too long to run on the last two test cases.  (And I had commented a line which would have allowed the program to run in time for the last test case! :x )

So I got 15/15 in S1, 11/15 in S2, and 9/15 in S3, for a total of 35.  I guess that's alright, but I know I could've done better.  But I bet a lot of people are thinking that right now...
Overall I enjoyed it. :)

-----------------------------------
Tony
Thu Feb 26, 2004 11:32 pm


-----------------------------------
lol :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 :roll: no common questions :?

-----------------------------------
amvbse
Thu Feb 26, 2004 11:34 pm


-----------------------------------
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
Fri Feb 27, 2004 7:38 am


-----------------------------------
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 :? ... :think:

i guess i should have taken the junior :oops:

-----------------------------------
bugzpodder
Fri Feb 27, 2004 7:43 am


-----------------------------------
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
Fri Feb 27, 2004 12:55 pm


-----------------------------------
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
Fri Feb 27, 2004 3:49 pm


-----------------------------------
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

-----------------------------------
zylum
Fri Feb 27, 2004 4:18 pm


-----------------------------------
well then why does it work for the first 2 and not the others? hmm... i checked my orientation and i cant seem to find any mistakes...

-----------------------------------
zylum
Fri Feb 27, 2004 4:22 pm


-----------------------------------
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 :? ... :think:

i guess i should have taken the junior :oops:

lol, i should have taken junior too!!! (i only have 1 credit of compsci)  it would have been sooo much easier lol... well atleast i would have gotten a better score than i did on the senior... i made some pretty stupid mistakes on the senior one :(

btw, can someone plz post the J5 question??? i want to see if its as difficult as everyone says it is

-----------------------------------
Touya-kun
Fri Mar 12, 2004 5:31 pm


-----------------------------------
I'm in Grade 10 (but taking grade 11 comp sci), and I got 59. Scarily enough, that's actually the third-highest mark in the school. I didn't get J5, and for some reason, on the J4 question, one of my outputs came out a character too short. All the other outputs worked fine--but this one was missing an "I" at the end. I still have no clue why.  :roll: 

Ah well, there's always next year :D

-----------------------------------
TheZsterBunny
Mon Mar 15, 2004 9:20 am


-----------------------------------
Same. I finished with 59 in the junior, and lost one mark one the first question.

"The square has a side length of: #", I put.

Needed "The square has side length of: #"

one letter...

-bunny

-----------------------------------
bevoyleick
Tue Mar 16, 2004 7:36 pm


-----------------------------------
it was SO crappy, the judges suxxor!!! they told us not to put extentions to our code in our "read-file" command, so we only put "data11" for the filename, but then we got a comment from the judges that said "Garbage, crashed". How the hell are we supposed to read files in Turing without adding extensions??

-----------------------------------
AsianSensation
Tue Mar 16, 2004 7:50 pm


-----------------------------------
umm..easy?

var filein : int
open : filein, "data11", get

no extension is required for input and output to files.

-----------------------------------
bevoyleick
Wed Mar 17, 2004 9:54 am


-----------------------------------
what?? does it even work? how does turing know how to read the file if it doesn't have the extensions??

-----------------------------------
Tony
Wed Mar 17, 2004 11:19 am


-----------------------------------
what?? does it even work? how does turing know how to read the file if it doesn't have the extensions??
 :lol: it reads its ASCII or binary depending on how you open the file. Just cuz the extension says its a photoshop file, turing will not become a drawing program if you open that file :lol:

-----------------------------------
bevoyleick
Fri Mar 19, 2004 6:54 pm


-----------------------------------
why did the program run fine when we added ".txt" to the read file command then?

-----------------------------------
AsianSensation
Fri Mar 19, 2004 7:31 pm


-----------------------------------
maybe when you declared it in turing, you had .txt?

open : filein, "data11", get

and

open : filein, "data11.txt", get

are two different things

-----------------------------------
bevoyleick
Sat Mar 20, 2004 12:03 pm


-----------------------------------
no, in all our read file commands, the filename is saved as a string, so we only had to change the value of the string at the start of the program and it'll apply to the rest. and we did put "data11" as the string value.

-----------------------------------
AsianSensation
Sat Mar 20, 2004 6:32 pm


-----------------------------------
well, the file itself might be named "data11.txt". Unless I see the actual code and know what happened there, I really can't tell you exactly what. But I am very certain that you can input and output to files without extensions, I should know, done it countless times at the DWITE competitions.

-----------------------------------
the_short1
Wed Mar 24, 2004 10:17 pm


-----------------------------------
whens the next contest i mite want to enter.....
'*** a teacher suggested after seeing my pacman, text twist, and download manager

-----------------------------------
bugzpodder
Thu Mar 25, 2004 6:59 am


-----------------------------------
i've entered the contest enough times but i've never figured out how to do pacman or any other sort of graphics stuff.  :(

-----------------------------------
TheZsterBunny
Thu Mar 25, 2004 7:28 am


-----------------------------------
short 1, before you say anything, remember that bugz does not use turing for his programs. I don't know if you do or not (not a huge pac-man fan), but before you start typing out hundreds of lines of message, remember: They do not use turing.

-----------------------------------
the_short1
Thu Mar 25, 2004 6:18 pm


-----------------------------------
they dont use turing for the cobntest for junior....hmmm... any contests for turing???? i will have to learn c++ over summer....

hmm... zester.... u should try my game even if ur not a fan...  :P  its  8) 
bugz pac man for me... took 3000 Lines... so ... yea... 
OMFG!!!!! i just though of how to reduce like 300 LIENS of code... SWEET!

if Input.KeyDown (Control) (chr for down)

if whatdotcolor (pacmx,pacxy-25) = wallcol then
move := 0 