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

Schedule, Saturday, 4 October 2025

Time Event Location
10:00 โ€“ 10:15 Recommended arrival JTH (yellow building)
10:15 โ€“ 10:45 Introduction Presentation Stora Enso E1029 Auditorium
11:00 โ€“ 16:00 Main Contest (NCPC 2025) Husqvarna E1028, Finnveden E1022
Around 12:00 Light lunch is served Galleriet E1120
16:00 โ€“ 16:30 Quick Award Ceremony Stora Enso E1029 Auditorium

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 (event 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 Lucy Ellen Lwakatare and Masoumeh Taromirad as co-coaches)

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 Lucy Ellen Lwakatare and Masoumeh Taromirad as co-coaches)

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

.