Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!ames!ncar!tank!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!p.cs.uiuc.edu!gillies From: gillies@p.cs.uiuc.edu Newsgroups: comp.misc Subject: Re: Silly programming problems Message-ID: <79700028@p.cs.uiuc.edu> Date: 19 Mar 89 01:45:00 GMT References: <817@krafla.rhi.hi.is> Lines: 26 Nf-ID: #R:krafla.rhi.hi.is:817:p.cs.uiuc.edu:79700028:000:959 Nf-From: p.cs.uiuc.edu!gillies Mar 18 19:45:00 1989 Here are some memorable problems from some high school programming contests ten years ago. About 1/5 of the entrants solved 7 problems (all of them) in 3 hours: 1. Compute 2^60 EXACTLY and print out the result (note: this can be done cleverly using two or three 32-bit words, and manually shifting the overflow to the second or third variable) 2. Compute 1/(2^60) and print out the result. [Next year's problem] 3. Define a "perfect card deck shuffle". Assume the cards are numbered 1..52. Where is 13 after 2087 (or some huge number) of "perfect shuffles". 4. Write a program to translate integers to roman numerals, and print them (judge tests the program interactively) 5. Compute the number of ways to make change for $1, $2, and/or $5, using (whatever assumptions you want about legality of dollar bills). If you have young contestants, remember to include a few "easy" problems so nobody goes home unhappy. Good luck with your contest!