Create a Kattis Account
- 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
- Log into open.kattis.com.
- Choose the Help tab, then choose the How to submit link located near the bottom of the page.
- Scroll down to the section titled Downloading a configuration file and client and download your personal configuration file and the Kattis client.
- Open terminal or GitBash and change the working directory to the location of the files you downloaded (perhaps in your download directory). Then use the following command to copy the files to your home directory on your VM.
scp -i <path to keypair file> <file name to transfer> ec2-user@<ip address>:<file name to transfer>
Note that when typing the above command you need to replace <path to keypair file>, <file name to transfer>, and <ip address> with appropriate information.
Setting Up Submit.py
- SSH into your VM.
- Run chmod 700 submit.py.
- Create a subdirectory in your home directory named bin and move submit.py into bin.
- Verify that $HOME/bin is in your $PATH. If not, add it.
- Run sudo pip install configparser.
- Make two edits to submit.py.
- Remove the 3 from the first line. The first line should read #!/usr/bin/env python.
- Add a line that reads import configparser.
Setting up .kattisrc
- Rename the kattis config file (e.g. kattisrc.txt) to .kattisrc.
Testing the Script
- Navigate to https://open.kattis.com/problems/hello with a browser to view the hello problem.
- Write a program on your VM that solves the hello problem with a class named Hello in a file named Hello.java.
- Submit your program to Kattis using the following command:
submit.py -p hello -l Java -m Hello Hello.java
- 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.