Competitive Programming @ JTH/JU

2024-2025 Rudy Matela (rudy.matela@ju.se), JTH

Since 2023, JTH/JU has been participating in programming competitions/contests:

mainly in the Nordic Collegiate Programming Contest (NCPC).

The NCPC format:

 

  • 1 problem solved = 1 balloon!

How are the problems?

e.g.: NCPC 2022 Problems

  • Programming with emphasis on Algorithms and Data Structures;
  • There’s usually an easy problem that everyone can solve;
  • Then progressively harder problems;
  • … up to a problem that only 1 or 2 teams can solve.

An example problem:

Highest Hill from NCPC 2022. (CC-BY-SA)

Highest Hill (1)

Some not-so-relevant text/story:

Sweden may not have a particularly impressive mountain range compared to other NCPC countries such as Norway and Iceland, but at least it beats the flatlands of Denmark. The situation is not so clear when comparing other member countries though. For example, is Estonia more mountainous than Lithuania1? To settle this question, you want to determine which of the two countries has the most impressive mountain peak.

Highest Hill (2)

A mountain range is defined by sampling the heights hi of n equidistant points. Within a mountain range, we call a triple of indices 1 ≤ i < j < k ≤ n a peak if hi ≤ ⋯ ≤ hj ≥ ⋯ ≥ hk. The height of a peak is defined as the smaller of hj − hi and hj − hk.

Given a mountain range, can you find the height of its highest peak?

Highest Hill (3)

Sample Input 1

11
0 1 2 3 4 5 4 3 2 1 0

Sample Output 1

5

Highest Hill (4)

Sample Input 2

10
29 85 88 12 52 37 19 86 7 44

Sample Output 2

67

Can you solve this?

 

n, the number of samples, may go up to 200000!

 

The competition stages:

  1. NCPC: Nordics
  2. NWERC: NW EU
  3. EUC: Europe
  4. ICPC: World Finals

Qualifying teams move to the next stage.

The calendar:

contest when
registration September
1. NCPC early October
2. NWERC late November
3. EUC late February
4. ICPC Aug-Sep

(Qualifying teams move to the next stage.)

There’s an intricate web of competitions worldwide…

Being in Sweden, you nevertheless start at the NCPC.

Here!   ⬆️

NCPC 2025

When?

  • Saturday 4 October 2025 10:00 – 16:00.

Where?

  • JTH (provisionally)

 

 

  • In 2023 and 2024, we drove to Linköping and competed there;

  • For 2025, we have a plan to host it at JTH.

Why participate?

  • Its fun! You get baloons 🎈🎈🎈!
  • A great way to practice programming: data structures, algorithms, etc.
  • Coursework: gets easier.
  • Teamwork.
  • Meet people / networking.
  • Potential travel (if you qualify)
  • Nice for your CV.
  • “Meet” companies (sponsors).

For NWERC, there’s even a livestream with live scoreboard, a narrator, a commentator and whatnot:

Would you like to participate?

  1. form a team of 3 JU students;
  2. contact a JU/JTH lecturer to be your team coach:
    • your coach is responsible for registering you;
  3. start practicing.

… not necessarily in the above order…

For CSE/AIE students: Rudy Matela (rudy.matela@ju.se) can be your coach if you like. (with Masoumeh Taromirad as the co-coach)

For students of other programmes: find a coach within your programme/department.

JU Kod Study Group

How to practice?

Join the JU Kod study group.

We have a mailing list and a Discord server. We have occasional meetups and practice sessions. You can find more information on our website.

The mailing list is maintained by Rudy Matela. Let me know if you want in and you’ll be informed of when we hold practice sessions, contests or meetups.

The Discord server is maintained by students (Rudy is not there).

https://jukod.github.io/

JU Kod Study Group (2)

On the JU Kod website, you’ll find a list of interesting problems to start practicing:

They’re all from past editions of NCPC.

They are hosted on open.kattis.com, you can submit your solutions to be graded automatically as if you were in the competition/contest.

 

You can find all problems for the past decade on open.kattis.com: NCPC 2024; NCPC 2023; NCPC 2022; NCPC 2021; NCPC 2020; NCPC 2019; NCPC 2018; NCPC 2017.

https://jukod.github.io/

JU/JTH @ NCPC: summary

NCPC #-solved ps. 🇸🇪-rank 🇸🇪% rank %
NCPC 2023 5 🎈🎈🎈🎈🎈 24th / 36 top 66% 89th / 160 top 55%
NCPC 2024 4 🎈🎈🎈🎈 9th / 23 top 40% 39th / 139 top 30%

… also: 3 problems solved at NWERC 2024!

Think you can do better? Join next time.

NCPC #-teams #-students
NCPC 2023 👥 (1) 🎓🎓🎓 (3)
NCPC 2024 👥👥👥👥 (4) 🎓🎓🎓🎓🎓🎓🎓🎓🎓🎓🎓 (11)
 
NCPC 2025 👥👥👥👥👥… (¿≥5?) 🎓🎓🎓🎓🎓🎓🎓🎓🎓🎓🎓🎓… (¿≥12?)

 

We want to increase our participation in future contests.

Would you like to participate?

  1. form a team of 3 JU students;
  2. contact a lecturer to be your team coach:
    • your coach is responsible for registering you;
  3. start practicing.
  4. Join JU Kod for practice, tips and tricks.

… not necessarily in the above order…

For CSE/AIE students: Rudy Matela (rudy.matela@ju.se) can be your coach if you like. (with Masoumeh Taromirad as the co-coach)

For students of other programmes: find a coach within your programme/department.

jukod.github.io/slides

jukod.github.io/slides

.

To compile this document from source run:

pandoc --title "JU Kod" -tslidy -s slides.md -o slides.html

You need pandoc installed.

This slide set can be found on:

https://jukod.github.io/slides

.