
-----------------------------------
riveryu
Sat Aug 23, 2008 11:52 am

[CCC] Do you need to handle invalid input?
-----------------------------------

if (x 5 || y  5 )
System.out.print("Error:you suck");

-----------------------------------
Tony
Sat Aug 23, 2008 12:02 pm

RE:[CCC] Do you need to handle invalid input?
-----------------------------------
No.

If the question says that the input will be within a certain range, it will be within that range.

That is, unless the question specifically says otherwise.

-----------------------------------
riveryu
Sun Aug 24, 2008 5:05 pm

RE:[CCC] Do you need to handle invalid input?
-----------------------------------
O, alright thanks. Have you tried Junior CCC, what advice would you give ? Also, I've another question.

How is your solution means judged ?

If the problem can be solved with both recursion and iteration, will recursion be more favored by the judges?

Or, are the problems always made in a way so that only one approach may work to the conditions?

-----------------------------------
Tony
Sun Aug 24, 2008 5:14 pm

Re: RE:[CCC] Do you need to handle invalid input?
-----------------------------------
Have you tried Junior CCC, what advice would you give?
Check out the practice questions to see what kind of problems you should be able to solve. Aim to learn algorithms, patterns, ideas; not memorizing a solution to a particular problem.

Practice by taking part in the DWITE rounds.

The solutions are judged based on the accuracy of the output; though there's always a requirement for the program to execute in a "reasonable time" (few seconds tops), so sometimes the data range (the "N up to [some large number]" part) will dictate one approach over another for full marks (that is, you could score partial points for small cases with an inefficient solution, and time out on larger sets).

-----------------------------------
nike52
Sun Aug 24, 2008 5:26 pm

Re: [CCC] Do you need to handle invalid input?
-----------------------------------
Sometimes the problem has one approach, two, or even three, but one approach to the problem is the most common.
http://access.mmhs.ca/ccc/index.htm

Advice? Try the problems on your own. If you get stuck, look at the solutions until you're able to attempt the problem on your own again. Read the different solutions to the problems. Expect to spend a lot of time learning how to solve certain problems before you even start worrying about how quick you can do them. Problems where you looked significantly at the solutions, do them again when you feel you've forgotten most of the steps to solve the solution. And if you want, there are also more tips you can find with a simple search. Spend a lot time practicing for the ccc, and you'll do fine.

-----------------------------------
riveryu
Sun Aug 24, 2008 8:16 pm

RE:[CCC] Do you need to handle invalid input?
-----------------------------------
Thanks a lot guys, I'm gonna practice old CCCs now.
