CPC Kattis Guide
 

what is kattis?

Kattis is a competitive programming platform we use in the UNH CPC. The Kattis Problem Archive holds over 3,500 programming problems with a wide range of difficulty. The platform also supports auto-grading in dozens of coding languages. We host competitions through Kattis and often work through their problems in our weekly meetings.

In addition to hosting competitive programming problems, Kattis helps interviewers find talented programmers. Startups especially like the platform, and they often post job ads on the website. So, doing well on Kattis could directly get you an interview! Kattis also hosts a Mimir-like grading service for universities.

signing up for kattis

Register for Kattis here. After you register, you should get sent a confirmation email. Follow the link inside it to verify your account.

The link should send you to your Profile Settings page. If it does not send you there, you can access it by clicking on your name in the top right corner of any page.

Kattis Home Page with an arrow pointing at the Settings Menu

Once in your profile settings page, change your Country, Subdivision, and University settings to match the ones seen in the image below.

Kattis Profile Settings

Now your account is all set! So what now?

Solving Problems with Kattis

Before you can solve a problem, you must first pick a problem. The home page for Kattis suggests a variety of problems that are suited to your account's level. Each problem has a difficulty from 1 to 10. Anyone who’s taken an intro CS course can solve a difficulty 1 problem.

These should be refreshed every so often. Clicking on any of these problems will lead you to their problem page. Alternatively, you can visit the Kattis Problem Page here.

Once you pick a problem, it will look something like this: Kattis Fizzbuzz Problem Page

Problems usually have the following layout:

On the rightside there is a tab titled Metadata. You can view additional information such as CPU Time Limit, memory, and other restrictions. Kattis will let you know if you failed due to any of these issues.

You can solve the problem in your browser using their embedded IDE, or alternatively work in an IDE of choice and then upload the source code afterward.

You need to take input from stdin to solve any problem, so make sure you understand how to grab input in your language of choice. Standard terminal input should work just fine (so Scanners in Java work just fine, streaming is unnecessary).

After submitting a problem, the website will run your program against test cases. If you pass all the tests, you will earn points based on the difficulty of the problem! However, it only tells you the number of cases you pass or fail, and not why you failed them. Because of this, you will have to test your program yourself.

Kattis Submission Results, showing date of submission, language, score, and other details

With all that, you should have more than enough information to get started!

Once you finish a problem successfully, feel free to post your source code in the Club Discord Server under the #solutions channel! If you do, make sure to include documentation that explains your solution. Screenshot of our our the #Solutions Channel inside of our Club Discord Server .

Kattis Contests

Occasionally we hold Contests via Kattis. These are fairly casual, and typically its just a convenient way of sorting all the problems in one place. At the time of writing, these typically last for one full week. Sometimes we will hold one-day contests instead, which last from the start to the end of each meeting. Details for each meeting will be announced via our Discord Server

Screenshot of a Kattis Contest Page

The bar at the top of the page represents the time left in the contest. You may or may not need to click the "start contest" button at the bottom right of this bar to participate.

There are four tabs below the bar. The most important is the Problems tab which contains links to every problem in the contest.

You can click on the Standings Tab to see everyone's current scores and what problems people are working on.

Additional resources

Need more help getting started with Kattis? Checkout the link below for language specific guides made by Kattis themselves. These guides cover ore about input and output, which is essential for solving problems on their site. Language-specific Kattis Tutorial (7 Min read)

Interested in learning more about Competitive Programming in general? Here's an article by USACO, which contains a high-level overview of Competitive Programming, common themes, and example problems. Includes an example with full solutions in multiple languages from Kattis. Introduction to competitive programming with USACO (15-30 min read)