Computer Association of SIUE - Forums

CAOS Forums => Academics => Topic started by: William Grim on 2006-09-23T00:30:46-05:00 (Saturday)

Title: Sphere Online Judge
Post by: William Grim on 2006-09-23T00:30:46-05:00 (Saturday)
For those of you that like to solve ACM or TopCoder problems, here is something else you can try: Sphere Online Judge (http://www.spoj.pl/).

In particular, I found this problem quite enjoyable.  I tried it in Python but couldn't get Python to run quickly enough.  I redid it in C, and it ran quite nicely but still has room for improvement: https://www.spoj.pl/problems/PALIN/ (https://www.spoj.pl/problems/PALIN/).
Title: Re: Sphere Online Judge
Post by: Justin Camerer on 2006-09-24T13:03:27-05:00 (Sunday)
http://codegolf.com seems fun too.
Title: Re: Sphere Online Judge
Post by: blacklee on 2006-09-25T00:25:03-05:00 (Monday)
Figuring out compilers issues seems to be an ongoing problem for me with the online judge. Does anyone else have this problem?. Probably some detailed instructions are out there somewhere, I just can't find them. I even remember Andrew explained it to me on this forum, but I can't find that post now either.  :cry:

Mike, my program doesn't compile with the judge. I get compilation errors "function is not declared in this scope." I'm sure it has something to do with the compiler, because it runs fine in Visual Studio. Any ideas?
Title: Re: Sphere Online Judge
Post by: William Grim on 2006-09-25T02:50:18-05:00 (Monday)
Make sure you're uploading your code with the compiler set to "g++", not "gcc".  Also, it's best to test your code on home.cs.siue.edu before you upload, because VS2005 is not as standards-compliant as GCC.  GCC will tell you about a lot of errors that VS2005 will ignore.
Title: Re: Sphere Online Judge
Post by: blacklee on 2006-09-25T10:33:10-05:00 (Monday)
Thanks Mike, it worked. I can't believe some of the errors VS ignored.
How do some people get 0.01 run time? I wish I could see their code. Replacing cin/cout with scanf/printf cut down time from 1.14 to 0.24 for me; but changing functions to inline and doing bitwise instead of arithmetic operations   :oops:  didn't affect timing much.
Does the program run time matter in the live contest?