Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Free Range Code wrangling
Index -> Contests
Goto page 1, 2, 3  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
md




PostPosted: Sat May 20, 2006 11:33 pm   Post subject: Free Range Code wrangling

Rules:

1. Entries may be written in any language; however I can only verify solutions to programs written in languages for which a free compiler is available. This means no turing (unless someone else wants to verify those solutions...).
2. You may submit as many solutions as you wish for each problem, however only the last one submitted will be accepted.
3. Solutions should be emailed to contest@nxor.org with the subject "Compsci.ca Contest"; and have a compsci.ca username and the question # clearly identified. Questions can be asked by email (same address) or forum post; PMs will most likely be ignored.
4. Points will be awarded as follows: 5 points for each working solution, 2 points for a partially working solution, and no points for a non-working solution, or absent solution. At the end of the contest the user with the most points shall be declared the winner. Prizes will be $10 for first place and $5 for runner up; as well as bragging rights. To be elegible to win you must have at least 20 points.
5. This contest is open to teams, with the prize being split equally among the winners. Teams shall be no larger then two people, and they shall receive one less point per additional team member, or 1 point whichever is greater. (Example: if you have two people in your team you will only get 4 points for a complete solution and 1 for a partial solution). Teams must be clearly identified in solutions.
6. This contest will run two weeks from today (the 21st of may), though it may be extended for an additional week if enough people request it.
7. Questions may be changed if they are found to be too trivial. The reason is that the prize is real money and I want people to work for it.

Questions:

#1 Write a program that finds the series of consecutive positive integers whose sum is exactly 10000. If there is more then one such series find all of them.

#2 Write a program that finds a four digit number all of whose integral powers end with the same four digits as the original number. If there are more then one such number find them all.

#3 Write a program that finds four dollar amounts such that the sum of the four amounts and the product of the four amounts is equal to $9.81. If there is more then one solution find them all.

#4 Write a program that finds a six digit number such that it can be split into two parts or three digits each, and when those parts are added and the sum squared you get the original number.

#5 Write a program that finds a four-digit number that is the sum of the fourth power of it's digits.

#6 Write a program that finds the smallest number that is the sum of two pairs of cubes. That is a, b, c, and d are four unique postitive integers such that a^3 + b^3 = c^3 + d^3. There is a solution where a^3 + b^3 < 32768. You should print out hte four integers; and the answer to a3 + b^3.

#7 Write a program that finds at least the first five sets starting with 3^2 + 4^2 = 5^2, such that
1.Each set is a set of n consecutive integers, where n is odd
2.The sum of the squares of the first n/2 + 0.5 numbers equals the sum of the squares of the last n/2 - 0.5 numbers
3.The left side of the equation has one more term then the right
Output the entire set in order of lowest to highest as well as the sum of each side of the equation.

#8 Write a program that finds two five-digit numbers that between them use the numbers 0-9 only once each, such that the first number divided by the second number is equal to 9. If there is more then one solution find them all.

#9 Write a program to find all the 9 digit numbers that are perfect squares and that use each of the digits 1 through 9 once each.

#10 Write a program that finds all whole numbers (with fewer then six digits) that are equal to the sum of the factorials of their digits. The first two solutions are trivial: 1! and 2!. For a three digit number the equation would be A! + B! + C! = ABC.

#11 Write a program that finds an integer that, when a specific digit is removed, is reduced to one-ninth of it's value and that, when a second digit is removed is further reduced to one-ninth of the second value. Your program should print out the lowest complete set of numbers.

#12 Write a program that finds the smallest perfect square that begins with exactly sixteen 7s and also finds it's square root. Your program should be able to find a square starting with any specified set of digits.

Bonus: Write a program to for all totals less then $10, finds all sets of four dollar values whose sum is the same as their product.

Good Luck!
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sun May 21, 2006 8:19 am   Post subject: (No subject)

Nice, Cornflake!

I have a question: How does speed affect the score for each solution? If a solution works but takes 30 minutes to complete, what score does it get? I'd say 0, but who knows--you're one of those crazies that leaves their computer on all night. Wink
cool dude




PostPosted: Sun May 21, 2006 10:18 am   Post subject: (No subject)

so i'm guessing no turing or visual basic Sad is that for sure? i can try writing it in java but i just started learning it so i don't think i will have enough time doing it in java.
Tony




PostPosted: Sun May 21, 2006 11:36 am   Post subject: (No subject)

cool dude wrote:
but i just started learning it so i don't think i will have enough time doing it in java.

well actually this could be your motivation to learn Java. It's best to learn with practice, and those questions take your practice outside of the "Hello World" comfort zone. Wink
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
cool dude




PostPosted: Sun May 21, 2006 11:42 am   Post subject: (No subject)

Tony wrote:
cool dude wrote:
but i just started learning it so i don't think i will have enough time doing it in java.

well actually this could be your motivation to learn Java. It's best to learn with practice, and those questions take your practice outside of the "Hello World" comfort zone. Wink


true but unfortunately i still have school and exams are just around the corner so i really don't have the time. if this contest was done in the summer then i would have more time.
md




PostPosted: Sun May 21, 2006 11:52 am   Post subject: (No subject)

Points have no relation to execution time; except in that if it takes more then 15 minutes your doing something wrong and you get 0 points. There are solutions in BASIC that take < 10 minutes on a 386.

And yes; turing and visual basic are out. C# might work if I can get it to complile with mono. In fact I'll even accept progams I cannot compile if you can also give me a executable (for linux).

The thing about most of these questions is that they aren't terribly hard, so part of teh challenge is writing solutions in a new language.
cool dude




PostPosted: Sun May 21, 2006 11:57 am   Post subject: (No subject)

k i will try writing some of them in java if i have time. is it okay if i just do some of the problems and not all of them. i'm not looking to win just to try.
md




PostPosted: Sun May 21, 2006 12:00 pm   Post subject: (No subject)

cool dude wrote:
k i will try writing some of them in java if i have time. is it okay if i just do some of the problems and not all of them. i'm not looking to win just to try.


You can do whichever questions you want; and you can only solve them partially if you wish. You could even team up with someone and try and get more points that way.

Question #6 had been changed slightly. Now you need to output one additional number: the sum of a^3 + b^3.
Sponsor
Sponsor
Sponsor
sponsor
bugzpodder




PostPosted: Sun May 21, 2006 1:27 pm   Post subject: (No subject)

all these problems have deterministic solutions. so all you have to do use find the answers, and use cout. I guarentee you that your solution will run less than 15 minutes. You can even just write a script that uses only echo command in linux.
bugzpodder




PostPosted: Sun May 21, 2006 1:31 pm   Post subject: (No subject)

and double check #3 while you are at it.
bugzpodder




PostPosted: Sun May 21, 2006 1:34 pm   Post subject: (No subject)

anyone interested, similar problems can be found in project euler
http://mathschallenge.net/index.php?section=project
bugzpodder




PostPosted: Sun May 21, 2006 1:39 pm   Post subject: (No subject)

and more similar problems (and a few are the same, sorry no solutions there) can be found at: http://homepages.transy.edu/~jmiller/web706/second.htm
Cervantes




PostPosted: Sun May 21, 2006 2:04 pm   Post subject: (No subject)

bugzpodder wrote:
and double check #3 while you are at it.


Cornflake wrote:

#3 Write a program that finds the two numbers whose cubes add up to exactly 6

3^(1/3) and 3^(1/3) do it. Were they supposed to be distinct? 2^(1/3) and 4^(1/3). How many solutions to this are you supposed to find?
md




PostPosted: Sun May 21, 2006 4:29 pm   Post subject: (No subject)

Yes the questions are deterministic. However you will get negative points if you submit a program that just writes out answers. That is not the point of this contest. The point is to write a program that calculates the correct solution (or solutions); and hopefully to do it in a new language.

[edit]#3 has been changed because the original question was trivial. Most of these comments no longer apply Razz [/edit]

If people would stop discussing the questions here that would be most appreciated. Giving away hints (or answers) doesn't help at all... If you do have a question about the wording or meaning of a question that's fine.

(If a mod could remove the posts that don't match the above statement... that would be most appreciated).
rizzix




PostPosted: Sun May 21, 2006 4:39 pm   Post subject: (No subject)

sorry Embarassed
Display posts from previous:   
   Index -> Contests
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 3  [ 40 Posts ]
Goto page 1, 2, 3  Next
Jump to:   


Style:  
Search: