1 of 29

Pre-Competition Beginner Workshop

Presented by

2 of 29

3 of 29

What is a competitive programming contest?

“Competitive programming is solving well-defined problems by writing computer programs under specified limits.”

4 of 29

What’s the contest like?

  • Firstly, this is not a hackathon!
  • Many problems are math-y and it’s more about solving an algorithmic puzzle.

Don’t worry! We will look at a sample problem soon, and you will have the opportunity to submit solutions to a sample problem at the end of this workshop!

5 of 29

What’s the contest like?

  • For each problem your solution will be a complete program in a programming language of your choice.
  • Your solution will be run against numerous test cases to verify correctness.
    • Many problems have pesky edge cases that your program must handle in order to be considered valid.
  • We say this not to discourage you. Remember that CodeSprint is beginner-friendly and we’re all here to help you! We think you will have a great time if you enjoy problem solving even though coding such solutions might be new to you.

6 of 29

Scoring

More details in the guide!

  1. More problems solved = Higher rank

In case of same number of problems solved,

  1. Less time = Higher rank
  2. Fewer incorrect submissions = Higher rank

7 of 29

What does the contest page look like?

8 of 29

Checkpoint 1

Access your Kattis Account

9 of 29

How do I access Kattis?

  • To sign into Kattis, you must use the same email address that you used to register with us for CodeSprint LA 2025.
  • You fall into one of two categories:

You already had a Kattis account associated with the email address that you registered with.

You did not have a Kattis account associated with the email address that you registered with.

  • You are set! Use the same login details.
  • You should have received an email from Kattis about setting up your account.

10 of 29

How do I access Kattis?

  • Here are the links to the contests:
  • You will not be able to see the problems until the contest starts :)
  • If you have issues accessing your account, please contact an organizer.

11 of 29

Kattis

The contest platform

12 of 29

Step 1: The Problem

13 of 29

What do problems look like?

Sample test cases

Problem Statement

I/O Description

Submit button

14 of 29

Step 2: Coding the Solution

15 of 29

What language can I code in?

We recommend C++ for competitive programming:

  • Very efficient (fast!) language
  • Standard library contains several data structures and algorithms

Other alternatives: Java and Python

16 of 29

Editor/Compiler Set up

  • If you already have a preferred code editor on your computer, and know how to run code in your preferred language for testing, great! You’re set!

  • If you use C++, Python, or Java, https://ide.usaco.guide works online without any setup

  • https://www.onlinegdb.com is another good free alternative, if you use a language unsupported by the above but supported by Kattis

17 of 29

Editor/Compiler Set up

  • https://www.onlinegdb.com/
  • Choose language from dropdown menu
  • Beware of ads → you may need to open inspect element to copy your code and refresh

18 of 29

Step 3: Submitting the Solution

19 of 29

What does a submission portal look like?

1. Upload your file here

2. Make sure programming language is correct

3. Submit!

Alternatively, paste your code here

20 of 29

What does a verdict look like?

Hidden test cases!

21 of 29

How do I know what’s wrong with my solution?

More details in the guide!

Error Messages

AC

Accepted

Congratulations! Your submitted solution is correct!

WA

Wrong Answer

Your submitted solution doesn’t pass one of our test cases

TLE

Time Limit Exceeded

Your submitted solution was too slow

CE

Compiler Error

Your submitted solution failed to compile

RTE

Run Time Error

Your submitted solution had an error while running

OLE

Output Limit Exceeded

Your submitted solution had too much output

MLE

Memory Limit Exceeded

Your submitted solution used too much memory

22 of 29

Summary

23 of 29

Step 1:

Read the problem

Step 2:

Code a solution

Step 3:

Submit your solution

to receive judgement

Summary

24 of 29

Common Mistakes to Avoid

  • Every solution should be a complete program that reads from stdin and writes to stdout. Just mere functions are not accepted!

Note:

You are free use to functions in your solution, however the function must not be the only thing in your solution. Your program must have a main routine!

25 of 29

Common Mistakes to Avoid

  • When asked to output two space-separated integers, make sure you put the space between the two integers!

  • When asked to output two lines, with two space-separated integers per line, make sure you print out the separated integers on separate lines!

26 of 29

FAQ

  • Should I solve the problems in order?
    • Not necessarily. You are free to solve the problems in any order you like!
    • Note: Beginner problems are generally in order of difficulty.

  • Are all problems equally weighted?
    • Yes! As discussed in the scoring section, your rank is primarily based on number of problems solved.

27 of 29

If you encounter any issues during the contest...

  • Reach out to us on the Discord #help channel!

28 of 29

Checkpoint 2

Sample Contest

29 of 29

Sample Contest

  • Link to contest: