Author |
Message |
Kongaloosh
|
Posted: Thu Feb 02, 2012 1:20 pm Post subject: Questions about CCC |
|
|
Hey, my school's never participated in the CCC and I'm trying to organize it, but there are a few things I don't know.
Do we get to use an IDE, or do we have to write by hand? Do you have to use a specific IDE?
Also, I saw a post saying Java is allowed for round 2 now, but I can't find it on the CCC site; anyone know if it's true?
thanks
-KGL |
|
|
|
|
|
Sponsor Sponsor
|
|
|
ProgrammingFun
|
Posted: Thu Feb 02, 2012 1:36 pm Post subject: RE:Questions about CCC |
|
|
You are allowed to use any IDE as far as I know. |
|
|
|
|
|
crossley7
|
Posted: Thu Feb 02, 2012 5:14 pm Post subject: RE:Questions about CCC |
|
|
You can use any language/compiler/ide you wish for round 1 provided your teacher is fine with it, but I believe only C++ and I guess now Java are accepted at round 2. I don't know of any restrictions on IDE though |
|
|
|
|
|
Tony
|
Posted: Thu Feb 02, 2012 5:35 pm Post subject: RE:Questions about CCC |
|
|
There are a few restrictions, the spirit of which is "No DSLs" (Domain Specific Language). If your tools (language, IDE, whatever) gives you functionality that feels like you're not really solving the intended question, then that shouldn't be used. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
ihsh
|
Posted: Thu Feb 02, 2012 6:20 pm Post subject: Re: Questions about CCC |
|
|
I have two more questions...
1. What's the maximum amount of time that a program can use to do the processing (for each test case)? If it's something like 1 minute, then many things can be brute-forced...
2. What kind of program is deemed "invalid"? I know that programs that do no processing and just output random numbers are not accepted, but how about hard-coded programs like the one below?
code: |
if (input==1)
output 123
if (input==2)
output 224
if (input==3)
output 0
... (and so on)
|
Thanks. |
|
|
|
|
|
ProgrammingFun
|
Posted: Thu Feb 02, 2012 6:24 pm Post subject: RE:Questions about CCC |
|
|
Your programs are initially scored and checked by your teacher so they would detect hard-coding and just disqualify you for that question. |
|
|
|
|
|
Tony
|
Posted: Thu Feb 02, 2012 6:36 pm Post subject: RE:Questions about CCC |
|
|
Your teacher would receive a package with marking instructions; those are authoratative on execution time and code quality.
My opinion is that implementing state-machines is a valid approach. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
A.J
|
Posted: Fri Feb 03, 2012 4:29 pm Post subject: RE:Questions about CCC |
|
|
Having marked the CCC before, and being on the committee, I will say that implementing state-machines (as Tony puts it) is valid; however, it is highly unlikely that you'll be considered for any of the regional prizes (or even for Stage 2), as if there's someone else who has achieved a similar score using a more 'standard' algorithm, they would be considered more. Having said that, I do encourage bashing out a question that you can't find an efficient algorithm to (as any points you can get counts), but please refrain from merely outputting random values in hopes of getting one of the test cases right (though most questions that require a single output do test multiple cases for each test case, and thus getting all of them correct by merely guessing is highly improbable). |
|
|
|
|
|
Sponsor Sponsor
|
|
|
ProgrammingFun
|
Posted: Fri Feb 03, 2012 5:34 pm Post subject: RE:Questions about CCC |
|
|
Thanks for the information...
...just to clarify, that means that hard-coding is allowed, and even encouraged if we're lost? |
|
|
|
|
|
mirhagk
|
Posted: Fri Feb 03, 2012 5:37 pm Post subject: RE:Questions about CCC |
|
|
Well if you can figure the program out manually, it may not be very complex... also the ones they give you as a sample input aren't the testing input.
So no, hardcoding is not really encouraged, random number generators might have a better chance lol. |
|
|
|
|
|
A.J
|
Posted: Fri Feb 03, 2012 5:58 pm Post subject: RE:Questions about CCC |
|
|
'Hardcoding' and 'randomly outputting values' are pretty much the same thing, and its not encouraged. However, coding up a brute force solution is highly encouraged, especially if you can't think of the most efficient algorithm. |
|
|
|
|
|
ProgrammingFun
|
Posted: Fri Feb 03, 2012 7:13 pm Post subject: Re: RE:Questions about CCC |
|
|
A.J @ Fri Feb 03, 2012 5:58 pm wrote: 'Hardcoding' and 'randomly outputting values' are pretty much the same thing, and its not encouraged. However, coding up a brute force solution is highly encouraged, especially if you can't think of the most efficient algorithm.
I fail to see the difference, sorry.
How would brute-force work if we're only given one trial of the program once it's submitted? To me, brute force would mean that for arriving at a solution, every combination would be tried by the program until a working one is achieved. |
|
|
|
|
|
A.J
|
Posted: Fri Feb 03, 2012 7:29 pm Post subject: RE:Questions about CCC |
|
|
Consider the integer knapsack problem. If one doesn't come up with the more efficient dynamic programming solution, they could always code up the brute force solution of trying all possible subsets of the inputs (i.e. O(2^n)). Although this is highly inefficient, it will pass for small cases.
However, randomly outputting '0' in hopes that one of the testcases actually tests a particular case will be frowned upon. |
|
|
|
|
|
Tony
|
Posted: Fri Feb 03, 2012 7:46 pm Post subject: RE:Questions about CCC |
|
|
A silly example is for the question "is the number prime?". Lets say that you can't figure out how to algorithmically check a number for being a prime, but you have a few of the cases memorized. Your program could be
code: |
if i == 2 then return true
elsif i == 3 then return true
elsif i == 5 then return true
...
else return false
end if
|
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
mirhagk
|
Posted: Fri Feb 03, 2012 8:30 pm Post subject: RE:Questions about CCC |
|
|
Lol I want to see someone do that lol Tony. |
|
|
|
|
|
|