UVa Submission Format and Comments

When submitting problems to the online UVa Judge each program should have the following attributes

  1. compileable by aan ANSI standard C++ compiler such as the g++ gnu linux compiler
  2. Have no include files that are not standard C++. The usually included #include “stdafx.h” file from Microsoft visual studio is not allowed.
  3.  If using MVSC be sure and turn off pre-compiled headers.
  4. Have your program read from stdin and write to stdout using cin and cout.  Never create and open files.

Test your program by creating a data file say data.dat and redirect it into the executable.   In linux you do something like  prog < data.dat on the command line.   In MVSC go to project |properties |configuration properties| debugging and then place <data.dat in the command arguments slot.  It then will automatically redirect the file into your program when you run it as stdin.  Capice!?  Put the data.dat file in the project under the second project name directory directory in the project.  This is where the readme file is located.

Comments and other words of wisdom

  1. Start your program by reading in the data and printing out the data.  Do this before you add other code to process the data.  THIS IS IMPORTANT.
2.  In most problems be sure and not have an extra blank line at the end of the output or an extra space at the end of a line.  There are a few problems that want the extra blank line at the end, READ the PROBLEM CAREFULLY.
3.  Always test a data value that is the maximum size of allowed data input.  Many of these will overflow if you have not programmed it correctly.  
5. Always check the other boundary conditions such as 0 or 1 or -1 or empty etc.  6. When you get the program running on the data given in the problem go to uDebug and get its example data set and run that thru you program.  If it matches uDebug’s output then you can submit it.
6. Visual has a few files auto included so you may occasionally get a compile error when you run it on the Judge.  Click on the error link and see what you did wrong or forgot to include.
7. Also check out http://www.outsbook.com/uva/?page=problem_hints for problem hints to the UVa problems.

Problems of interest from the UVa site

Problems

Very Easy (12372, 11498, 11172, 11727, 12403)

As we work on problems this semester we will add to this list.

Easy (1339, 11636, 10114, 11559, 11799, 10041, 10038, 10110)

Medium (573, 10141, 11507)

Problems that involve recursion ( 673, 10970)

Problems that use a stack (127,514,732)

Problems that use a queue (10172,10901,11034)

Problems that use a linked list (11988) Rare instance of a a list

Interesting Math Problems (10105, 10018, 11388, 10077)

 

Comments are closed.