The Forum > Technology > NP Python Olympiad
A real-time 2-hour Python competition. No prizes (yet), just for fun. Probably following the ACM style of college programming competitions
Like the old Ninja Coder, except the winner is based on speed and not code length. I just want to gauge some interest before I go through the trouble of putting together an auto-grader. |
I have been gifted with a few hours of spare time this weekend. I will use this to write the autograder I mentioned in the original post. Would anyone be interested in participating a dry run/beta test this Sunday at noon PDT? (also, I'm cross-listing this thread on TwoCans in case there's any interest there) |
I guess I'll explain the rules now... I will be adapting the ACM College Programming Competition style/rules or at least the parts that I remember. There will be three web pages that I will give you the URL's for. One will be a scoreboard listing everyone who is participating. One will be your current score. The other will be a list of 10 coding problems (links to problems. each problem will have its own page). The coding problem pages will have a prompt, some sample input of what your program should accept, and the sample output for that particular input. Below will be a submission form. From there you will paste your code and select whether it runs on 2.7 or 3.1. And then there will be a send button. Your scoreboard page will show you all 10 problems and what your current status is on each. When you submit a problem, this is the page that you will check to see if you completed it successfully. When you submit a problem, the auto-grader will pick up your code and run it against an unknown input. Not the one that was the sample input. The actual test data will probably be a much larger size than the sample data. The status for each problem will be one of the following:
The scoreboard for all players will just be a list of names with colored dots next to each. Each color represents a different problem. You will not know which color represents which. The problems will range in difficulty. Some will be really easy. Some will be not so easy. If you notice that everyone has the blue dot, yellow dot, and brown dot, and you only have the lavender dot, that means you probably started with a hard problem. You can do the problems in any order you want. ScoringThe person who solves the most problems wins. Plain and simple. No extra credit for solving hard problems vs solving easy problems. When you solve a problem, the time is recorded that you sent in your final submission for the code. The sum of the time it took you to solve all your correct problems is added together. This is called a penalty score. When you make a submission that is not correct, you will get additional penalty points equivalent to 10 minutes of unsolved time. This penalty score is used ONLY for tie-breakers between people that have correctly solved the same number of problems.
The competition lasts 2 hours. |
Here's some boiler plate code and a preview of how the problems will be written. Practice Problem #0 - DoubleWrite a Python program that takes in a list of numbers from standard input. These numbers will each appear on their own lines. Your program must double these numbers and print them each on a line to standard output.Sample Input5 7 3 8 1053 Sample Output10 14 6 16 2106 Below is an example of a correct answer. It is heavily commented. I'd be slightly concerned if you heavily commented yours to this degree. You are free to copy and modify this code for your own submissions. # loop through lines that come in from standard input while True: # take a line from standard input # In Python 2.x, use raw_input() # In Python 3.x, use input() # They are both the same function. Just different names. # Like "Hardees" and "Carls Jr." line = raw_input() # if the line is blank, you're done! there are no more lines. # ALL input will be terminated with a blank line if not line: break # if there is a line of input, then do whatever it is you need to do. # In this case, we are doubling the value. num = int(line) answer = num * 2 # to send something to "standard output", just print it # print includes a line break at the end of the string you provide. # conversely, you can print all your output at once and include the \n's yourself # remember, for Python 3.x, print statements require parenthesis # around the item you are printing print answer # another useful tip may be to build a list of all the lines # before doing your computation. This may be better for certain # types of problems. Testing your code:
If you are planning on participating, it's probably a good idea to just run through the bullet points up until the submitting process before the contest starts just to make sure you're all set up. And here it is |
The Forum > Technology > NP Python Olympiad
