Tag Archives: haskell

Competitive programming in Haskell: BFS, part 1

In a previous post, I challenged you to solve Modulo Solitaire. In this problem, we are given a starting number and are trying to reach in as few moves as possible. At each move, we may pick one of up … Continue reading

Posted in competitive programming, haskell | Tagged , , , , | 1 Comment

Competitive programming in Haskell: Kadane’s algorithm

I will be giving a talk on competitive programming in Haskell tomorrow, September 10, at Haskell Love. You should attend! It’s free! In my last competitive programming post, I challenged you to solve Purple Rain. We are presented with a … Continue reading

Posted in competitive programming, haskell | Tagged , , , , | 1 Comment

Competitive programming in Haskell: monoidal accumulation

In my last competitive programming post, I challenged you to solve Please, Go First. In that problem, we are presented with a hypothetical scenario with people waiting in a queue for a ski lift. Each person is part of a … Continue reading

Posted in competitive programming, haskell | Tagged , | 7 Comments

Competitive programming in Haskell: folding folds

Now that the semester is over—and I will be on sabbatical in the fall!—you can expect a lot more competitive programming in Haskell posts. In a previous post, I challenged you to solve Origami. j0sejuan took me up on the … Continue reading

Posted in competitive programming, haskell | Tagged , , , , , , , | 4 Comments

Competitive programming in Haskell: folding challenge

As of this writing, I am the only person who has solved Origami on Open Kattis (see the problem statistics here). This is a shame since it is a very nice problem! Of course, I solved it in Haskell. I … Continue reading

Posted in competitive programming, haskell | Tagged , , , , | 8 Comments

Competitive programming in Haskell: cycle decomposition with mutable arrays

In my previous post I I challenged you to solve Chair Hopping: if a bunch of people permute themselves according to the same rule twice, how many different rules could they be following which would result in the observed final … Continue reading

Posted in competitive programming, haskell | Tagged , , , | 2 Comments

Competitive programming in Haskell: 2D cross product, part 1

Time for some more geometry! In my previous post I challenged you to solve Cookie Cutters, which asks us to scale the vertices of a polygon so that it has a certain prescribed area. It’s possible to solve this just … Continue reading

Posted in competitive programming, haskell | Tagged , , , | 6 Comments

Competitive programming in Haskell: data representation and optimization, with cake

In my previous post I challenged you to solve Checking Break, which presents us with a cake in the shape of a rectangular prism, with chocolate chips at various locations, and asks us to check whether a proposed division of … Continue reading

Posted in competitive programming, haskell | Tagged , , , , , | 7 Comments

Competitive programming in Haskell: vectors and 2D geometry

In my previous post (apologies it has been so long!) I challenged you to solve Vacuumba, which asks us to figure out where a robot ends up after following a sequence of instructions. Mathematically, this corresponds to adding up a … Continue reading

Posted in competitive programming, haskell | Tagged , , , , | 2 Comments

Competitive programming in Haskell: permutations

In my previous post I challenged you to solve The Power of Substitution. This problem presents us with a substitution cipher, and asks how many times we would have to iterate the encoding process in order to turn a given … Continue reading

Posted in competitive programming, haskell | Tagged , , , , , , , | 5 Comments