Presentation is loading. Please wait.

Presentation is loading. Please wait.

Richard P. Simpson Midwestern State University

Similar presentations


Presentation on theme: "Richard P. Simpson Midwestern State University"— Presentation transcript:

1 Richard P. Simpson Midwestern State University
The Appropriateness of Competitive Programming and the UVa Online Judge in the Classroom Richard P. Simpson Midwestern State University

2 Competitive Programming
Competitive programming is a mind sport usually held over the Internet or a local network, involving participants trying to program according to provided specifications. Contestants are referred to as sport programmers

3 Catagories Short Term (1 to 5 hours) Long Term ( days to months)
ACM-ICPC  TopCoder IOI  (secondary schools) many others Long Term ( days to months) CodeChef and others

4 Training Resources UVa Online Judge SPOJ others Roll your own DOMjudge
Here you can develop your own problems (which are consequently new to the web!)

5 In the Classroom Students need considerable more practice with general problem solving. Students get a lot more work with STL Once a student has a bag of tricks, selecting the appropriate algorithm for a problem forces complexity considerations. The variety of ways students solve a particular problem results in interesting classroom discussions. (Efficiency!)

6 Faculty Resource The Uva online judge is a wonderful resource for problems of every imaginable type. Great for weekend projects which covers a specific topic. Run time interest is created!! Many problems force the student to handle all the corner cases. A great resource with problems for YOU to solve.

7 Programming Team Preparation
First started using the Uva Judge to prepare for the ACM programming contest. meet once a week to work on these problems. This forced me to start solving many of these problems as well.

8 A full course Developed a course that has students solve 2 to 3 problems a week. Allows the study of algorithms that do not naturally appear in our usual course sequence. Reminds students of algorithms they should already know (but forgot) Many problems are of the type that are asked in interviews.

9 Comment on Cheating Solutions to most of these problems can be found on the web This can be partly addressed by requiring a certain approach or DS be used. Most students are serious about learning to be a better programmer/problem solver. I am not going to punish the good students by excessively worrying about cheating. Exams will level the playing field.

10 UVa online judge UVa Online Judge is an online automated judge for programming problems hosted by University of Valladolid. Contains over 4300 problems which is constantly being expanded. A user may submit a solution in ANSI C (C89), C++ (C++98), Pascal, Java, C++11 or Python. 

11 Let go to the UVa Judge https://uva.onlinejudge.org/
Create an account if you do not already have one. Login Click on Browse problems

12 Browse Problems click here

13 Problems

14 Solving and Submission
All problems must read from stdin and write to stdout Only one file is submitted and it must have no non-library includes You may write your solution and test it using your favorite IDE such as visual studio c++ in windows code::blocks in Linux or even the cloud application repl.it

15 Redirect I/O in the IDE When you execute the program in your IDE you would like it to read from a data file when your program performs input. cin<< x<<y<<endl; Need to configure your IDE to do this by modifying the command line parameters i.e. add <data.dat Of course you can do everything at the command line and not worry about this.

16 Lets solve a trivial problem
Uva Relational Operators Open up your IDE Create a data file called data.dat Copy and paste the example data into this file Redirect the I/O (set the command line params) Write code to read in the data and write out the data. ( Do this for every problem you attempt) Now solve the problem on your local machine

17 Submit it and then check my submissions

18 Possible results AC - accepted WA – wrong answer
PE – presentation error CE – compilation error TLE - Time limit exceeded

19 I use the uHunt interface
look at students submissions

20 Debugging There are several things one can do to help in debugging problems use Uva’s debug for interesting test data and run checks. UVa toolkit read the discussions Watch for extra lines, extra spaces at the end of a line, numerical precision etc.


Download ppt "Richard P. Simpson Midwestern State University"

Similar presentations


Ads by Google