Sunday, May 2, 2010

ECOO 2010 Concludes

This years ECOO Provincial programming competition was quite epic. I, along with 3 other grade 12 members represented our school and qualified for the final stage of the competition held at York University with anticipation of making it to the top 10 teams. Turns out, we did (9th!). However, it was not easy. The problems were harder than what we had expected because usually the problems are very trivial.

I have posted another thread on the Compsci forum here.

Problem 1: Connecting the Dots



Solution: Basic trigonometry. Store vertices in two separate 1D arrays, sort them counter clockwise (always in quadrant I), calculate the arctangent, and multiply the x,y coordinates accordingly. In java:

ECOO Problem 1

Problem 2: Beowulf's Flight



Not a Solution! We didn't get full marks on this problem, but we came up with a last minute greedy heuristic DP approach that got partial marks (4/5). In java:

ECOO Problem 2

According to the forum, the optimal solution is probably an A* search. However, due to time restrictions of the contest, not many teams had enough time to implement it. I'll probably post another solution for this problem at a later time.

Problem 3: Mod 10 Arithmetic



Solution: Classic permutation problem. In java:

ECOO Problem 3

Problem 4: Almost Amicable Numbers



Solution: Span outwards from sod(x) looking for a number y such that distance from x to sod(y) is smaller than the distance from y to sod(x). In java:

ECOO Problem 4

Thanks to my friend AJ for supplying a C++ solution for this problem:

ECOO Problem 4

Now that i'm done with 'school' programming contests for the rest of the year, I am now gonna focus on physics contests. Speaking of, this week will be filled with physics-related competitions! Starting with the yearly OAPT grade 11 physics contest on May 4th, followed by the prestigious Sir Isaac Newton Exam on May 6th, to which I did quite well on last year even though I was in grade 10 (94.92 percentile). To end the week off, on May 7th, our school physics department will have their annual excursion for the Wonderland Wondercoaster Contest that I qualified for in the technical merit category. However, why not have fun instead? Summer is just around the corner, and some roller coaster rides will definitely get you in the mood. Not to mention getting the opportunity to experiment with accelerometers! Every young enthusiastic physicists dream.

What a fun week it will be! Oh joy!

No comments:

Post a Comment