Programming Contest & PC2
Original Slides by Brian Hare, James Cain, John Cigas PC2 DEMO by Ahmed Shamsul Arefin (PhD Student, CS/SE, UoN)
Main Features
Team programming
Typically 3 contestants per team 1 workstation per team
Several problems of varying difficulty Scoring based on number of problems solved
Ties broken based on time to complete Identifying problems that can be solved quickly is part of the challenge!
Problem set
For each problem:
Description, sample input/output For judges: Solution, Input file, Output file
Program can run w/o intervention (data entry, etc)
Usually console (text mode) based. Input usually via file in default directory, output to standard output.
Correct answer must be unambiguous & format specified
Description may include how to break ties Usually machine graded via file comparison of output
Variety of problem types
Graph, numeric, text-processing, geometric, optimization, etc
Each problem has 1 main feature
Parsing complicated input, producing complicated output, implementing complicated algorithm, etc.
Problem set
Boundary conditions specified for all problems
Judging input usually has at least 1 case that tests each boundary condition
Warn students if the obvious algorithm wont work (usually because of time limit)
No obligation to give them a hint about a better algorithm.
Range of difficulty
Goal is for all teams to be able to solve at least 1 problem, but no team solves all problems
Languages
Most contests restricted to C, C++, Java Difficulty should be roughly the same in each language
Some problems are fairly involved in C++ but theres a Java class that makes problem trivial Occasionally something in C++ STL causing same problem in other direction
Some problems that are fairly hard in system-level languages (C, C++, Java) are 5-liners in dynamic languages such as Python
So, hold Python contest separately from Java contest
5
Judging
ACM judging utility Program Contest Control (PC^2) program Manually
Copy source code to clean directory Build/Compile Copy input file to directory, run program Compare program output with judges output
Judging Feedback
For ACM, one of:
Submission error Run-time Error Time Limit Exceeded Wrong answer Presentation (format) error Success
Each incorrect submission (anything other than Success) adds 20-minute time penalty to score.
Other judging feedback
Clarification of problem
Only if:
Problem is ambiguous or incomplete, Sample input/output is incorrect or misleading, or Contestants question cannot be answered by closely reading the problem
Most common feedback is: Read the problem carefully.
Hardware/software troubleshooting
Every site directors nightmare. What do you mean, the debuggers not there? If students are just unfamiliar with this IDE, thats their issue.
Hardware
Dont need screaming new hardware BUT all teams should be on substantially equal footing
5 year old commodity workstations are fine, provided that everyones on similar 5 year old commodity workstations, so no one has any particular advantage
Software
ACM requires MinGW port of gcc for C and C++
ACM coordinating multiple sites worldwide; strictly local contests may have different needs.
Usual practice is to use freely available compilers/IDEs
Gcc (MinGW, Cygwin), etc. Eclipse, NetBeans, DevC
Some IDEs such as Eclipse support multiple languages, so only 1 IDE is needed Other compilers/languages should NOT be present on contest workstations
10
Whats allowed
Usually provide Java class documentation, C++ STL documentation from SGI Allowed to bring printouts, hardcopies, textbooks, etc at regional contests World Finals limit hardcopies to 25 pages
11
Whats not allowed
Internet access usually blocked Not allowed electronic media
CDs/DVDs Thumb drives Cell phones/smartphones Cameras Anything machine-readable
Calculators also prohibited
12
Infrastructure needed
Network connection if electronically submitting programs Printer for contestants (source code) Printer for judges (results, rankings)
13
What we need to do?
Writing/testing problems
Original problems vs published problems
Setting up workstations
Configuring software & testing configuration Setting up & testing judging software, PC^2
Preparing signage, running copies, ordering box lunches, etc Training/coordinating student volunteers Corresponding w/ other schools, contestants Reconfiguring our workstations
14
Resources
Google programming contest or programming challenge for many, many more, in many languages, at many levels.
15
Pc2 Login (team)
16
Interface after login
17
Select a Problem
18
Select a Language
19
Submit
20
Confirmation
21
! Judges secret end
22
Request Run by Judge and Response
23
Now! Teams end
2011 CCSC:CP Panel - April 8 2011
24
View other runs
25
Send a clarification
26
View clarifications
27
Standing
28