Using Kattis’ Client on Linux

Contents

Create a Kattis Account

  1. Create an account on open.kattis.com. Choose Log in with e-mail, then choose Sign up for a Kattis account. Use your Bridgewater College email address when creating an account.

Getting the Kattis Client and Config File

  1. Log into open.kattis.com.
  2. Choose the Help tab, then choose the How to submit link located near the bottom of the page.
  3. Read the How to submit page carefully before continuing.
  4. Scroll down to the section titled Downloading a configuration file and client.
    1. Cut and paste the contents of your personal configuration file into a new file on your laptop and save the file in your Downloads directory as kattisrc.txt.
    2. Download the Kattis client into your Downloads directory by clicking on the file name.
  5. Open terminal or GitBash and change the working directory to the location of the files you downloaded (in your Download directory).
  6. Use the following command to copy your personal configuration file and submit.py to your home directory on cs.bridgewater.edu.
scp <file name to transfer> <bc_username>@cs.bridgewater.edu:<file name to transfer>

Note that when typing the above command you need to replace <file name to transfer> and <bc_username> with appropriate information.

Setting Up Submit.py

  1. SSH into cs.bridgewater.edu
  2. Run chmod 700 submit.py.
  3. Create a subdirectory in your home directory named bin and move submit.py into bin.

Setting up .kattisrc

  1. Rename the kattis config file (e.g. kattisrc.txt) to .kattisrc.

Testing the Script

  1. Navigate to https://open.kattis.com/problems/hello with a browser to view the hello problem.
  2. Write a program that solves the hello problem with a class named Hello in a file named Hello.java.
  3. Submit your program to Kattis using the following command: submit.py -p hello -l Java -m Hello Hello.java
  4. Navigate to open.kattis.com with a browser and click on your name in the upper right corner to see if your solution was accepted.

© 2020 – 2022, Eric. All rights reserved.