Posts tagged with "Kattis"

Kattis Challenge "Grid"

Solved using a non-recursive version of BFS. Runs in pretty good time.

Published: April 28, 2018 | Last Modified: May 2, 2025

Kattis Challenge "Parking"

“When shopping on Long Street, Michael usually parks his car at some random location, and then walks to the stores he needs. Can you help Michael choose a place to park which minimises the distance he needs to walk on his shopping round? Long Street is a straight line, where all positions are integer. You pay for parking in a specific slot, which is an integer position on Long Street. Michael does not want to pay for more than one parking though. He is very strong, and does not mind carrying all the bags around.”

Published: September 15, 2017 | Last Modified: May 2, 2025

Kattis Challenge "Sum of Others"

“Every day, your job requires you to add up long lists of integers, like the following:

3 + 2 + -4 + 8 + 3 + -6 + 1 + 4 + 6 + -1 + -6 = 10

That is, a sum of positive and negative integers, followed by an equals sign, followed by a single integer. To save yourself some time, you normally leave out the and signs as you write down your work, so the previous example would be…”

Published: September 15, 2017 | Last Modified: May 2, 2025

Kattis Challenge "Line Them Up"

“An eccentric coach asks players on the team to line up alphabetically at the start of practice. The coach does not tell the players whether they need to line up in increasing or decreasing order, so they guess. If they guess wrong, the coach makes them run laps before practice. Given a list of names, you are to determine if the list is in increasing alphabetical order, decreasing alphabetical order or neither.”

Published: August 18, 2017 | Last Modified: May 2, 2025

Kattis Challenge "Server"

“You are in charge of a server that needs to run some submitted tasks on a first-come, first-served basis. Each day, you can dedicate the server to run these tasks for at most minutes. Given the time each task takes, you want to know how many of them will be finished today.”

Published: August 18, 2017 | Last Modified: May 2, 2025