Computer Science Canada

Computer Contest

Author:  octopi [ Wed Apr 23, 2003 8:07 pm ]
Post subject:  Computer Contest

So. Yeah, well I am starting a computer contest...

But since I am a cheap bast*rd theres no prizes. (I will donate every bit I have to the winner though. (Theres going to be a few tasks, I will add them when I think of them.))

Also, turing won't work with the way I am going to mark them (automated)
(That is if someone acctually submits any.)

here are the requirements

Must using a programming language that supports STDOUT (c++, perl, etc..)
You only need to include the executable version only.

Task A:
Write a program to find the prime numbers less then N.
A number is prime if it's only factors are 1, and the number.
Your program should run as "filename.exe N"
(anyone still following along?)

filename.exe 18
2 3 5 7 11 13 17
-Edited after darkness's comment

Your program must work for every test set. (1 point per test set)
Person with the most points at the end wins.

Tasks b...c...d.........
comming eventually.

Author:  Catalyst [ Wed Apr 23, 2003 8:40 pm ]
Post subject: 

what is stdout?

Author:  octopi [ Wed Apr 23, 2003 9:35 pm ]
Post subject: 

STandarD OUT

if you know c++
then it's

This little code example will show you how to output, and input the number.
(You need to compile it, and open a cmd window, and run it as
"filename.exe N" )
#include <iostream.h>

int main(int argc, char* argv[])
        cout << "This text will be outputed on STDOUT" << endl;
        if(argv[1] != 0){
           cout << "The N is : " << argv[1] << endl;
        return 0;

Author:  Catalyst [ Wed Apr 23, 2003 9:37 pm ]
Post subject: 

ah i did know cout

Author:  jamez [ Wed Apr 23, 2003 9:43 pm ]
Post subject: 

So we cant use Turing and simply ask the user (you) for N?

Author:  octopi [ Wed Apr 23, 2003 9:58 pm ]
Post subject: can't use turing, because it doesn't output on STDOUT
sorry, its just I have it so its really easy to test them, but it only works if your program outputs on stdout.

Author:  jamez [ Wed Apr 23, 2003 10:20 pm ]
Post subject: 


Author:  Tony [ Wed Apr 23, 2003 10:32 pm ]
Post subject: 

well if it outputs to STDOUT then you can have an automated judge that can mark programs online.... the problem with prime numbers is that since multiple solutions are already discussed on this site a program will result in infinite number of points or a tie for first place Confused

Oh, and in future if anyone comes up with a contest that people would participate in, staff will contribute to the prizes (most likely bits and emails if we feel generous)

Author:  octopi [ Thu Apr 24, 2003 12:02 pm ]
Post subject: 

yeah tony's right, its automated, and it only works if they output on stdout.
I don't see the problem with the primes thing, mostly because isn't all the primes stuff on this site in turing? (Can't use turing)

Anyways, thats only the first task, and there will probally only be 5-10 points(tests) per question.

Author:  jamez [ Thu Apr 24, 2003 2:40 pm ]
Post subject: 


its not that hard to convert from turing to c/c++ (usually Smile)

Author:  Martin [ Thu Apr 24, 2003 3:06 pm ]
Post subject: 

1's not prime

Author:  Tony [ Thu Apr 24, 2003 5:59 pm ]
Post subject: 

good point... but 2 is Very Happy