Submitting a Solution Using the Kattis Submit Script

If you are developing software on, you can use the Kattis script, named, to submit a solution.  It’s already installed on the machine in a directory that is on everyone’s path.  All you need to do is upload your personal configuration file into your home directory.

Uploading Your Personal Configuration File

Log into Kattis and download your personal configuration file onto your local machine by going to  Be sure to remember where you saved the file.

Then, using a SFTP client like FileZilla, copy the file from your local machine to your home directory on

Once the file is on close your SFTP client and log into with your SSH client (e.g. Putty).  Once logged on, change the name of the configuration file to “.kattisrc” using the linux mv command.

mv old-file-name .kattisrc

Your personal configuration file contains a private token.  You must not share this with anyone.  Your home directories have permissions set to 700 which means that you have read, write and execute permissions on your directory and everyone else has no rights what-so-ever.  I insist you keep it that way.

Submitting Your Kattis Solutions

Now you’re ready to use the submit script.  In order to use the script you need to

  1. Be in the directory that contains the source code that you want to submit.
  2. Know the Kattis problem identifier for the problem you are working on.
  3. Know which file your main() function is in.

The Kattis problem id can be found in the upper right corner of the problem’s Kattis web page as shown below.

When you’re ready to submit, simply type the following -p problem-id -m class-name -l Java files

where problem-id is the Kattis problem identifier and class-name is the name of the class that contains your main() function and files is a space separated list of your source code files.

For example, to hand in the problem named different we might enter the following: -p different -m Different -l Java

After you enter the submit command, you should see a prompt similar to the one below.

Problem: different
Language: Java
Mainclass: Different

If all of the information is correct, type a lower case y and hit ‘Enter’.  You should see a confirmation like the following.

Submission received. Submission ID: 1247718.

Within 1 minute of your submission, you should receive an email with the results.

© 2017, Eric. All rights reserved.