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 challenge you to solve it—bonus points for using a fold in your solution!

About Brent

Assistant Professor of Computer Science at Hendrix College. Functional programmer, mathematician, teacher, pianist, follower of Jesus.
This entry was posted in competitive programming, haskell and tagged , , , , . Bookmark the permalink.

8 Responses to Competitive programming in Haskell: folding challenge

  1. j0sejuan says:

    Nice problem! Unfold the paper folding unfolded points xD xD
    `unfold ls p = length $ filter inside $ foldr ((=

  2. Ryan Yates says:

    Nice one! Good to see 100% Haskell solutions :D.

  3. plosique says:

    Interesting problem. The ideas to solve it can be easily applied to writing a pixel shader for origami. https://www.shadertoy.com/view/ssXGDH

  4. Pingback: Competitive programming in Haskell: folding folds | blog :: Brent -> [String]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.