### Pages

### Categories

- AC
- algorithm
- announcement
- applicative
- art
- axiom of choice
- balanced
- Beeminder
- BFS
- bijection
- binary
- BlogLiterately
- category
- challenge
- combinatorial species
- combinatorics
- competitive
- constructive
- darcs
- data
- design
- diagrams
- dissertation
- drawing
- EDSL
- enumeration
- functional
- functional programming
- functor
- game
- geometry
- GHC
- graph
- graphics
- hackathon
- Hac φ
- haskell
- ICFP
- isomorphism
- Kattis
- library
- log
- monad
- monads
- monoid
- music
- natural
- number
- paper
- parsing
- partitions
- pedagogy
- productivity
- programming
- QuickCheck
- random
- release
- resource
- robot
- sampling
- search
- sets
- species
- subtraction
- Swarm
- talk
- teaching
- theory
- tree
- tutorial
- type-level
- Typeclassopedia
- types
- virtual
- workshop

### Archives

- March 2023 (1)
- February 2023 (2)
- January 2023 (3)
- December 2022 (2)
- October 2022 (1)
- September 2022 (1)
- August 2022 (1)
- June 2022 (1)
- November 2021 (2)
- October 2021 (4)
- September 2021 (5)
- August 2021 (1)
- June 2021 (3)
- February 2021 (1)
- July 2020 (2)
- June 2020 (3)
- May 2020 (4)
- April 2020 (2)
- March 2020 (2)
- February 2020 (4)
- December 2019 (1)
- November 2019 (1)
- October 2019 (1)
- July 2019 (1)
- May 2019 (2)
- April 2019 (2)
- March 2019 (1)
- February 2019 (3)
- November 2018 (1)
- October 2018 (3)
- June 2018 (1)
- May 2018 (4)
- April 2018 (1)
- March 2018 (2)
- February 2018 (3)
- January 2018 (1)
- November 2017 (1)
- September 2017 (1)
- June 2017 (1)
- May 2017 (1)
- April 2017 (1)
- March 2017 (1)
- February 2017 (4)
- January 2017 (3)
- November 2016 (2)
- October 2016 (2)
- September 2016 (3)
- August 2016 (4)
- July 2016 (1)
- June 2016 (1)
- May 2016 (3)
- April 2016 (2)
- March 2016 (3)
- February 2016 (1)
- November 2015 (2)
- October 2015 (1)
- August 2015 (2)
- July 2015 (1)
- June 2015 (3)
- May 2015 (2)
- April 2015 (1)
- March 2015 (1)
- August 2014 (3)
- June 2014 (2)
- May 2014 (2)
- January 2014 (2)
- October 2013 (1)
- August 2013 (1)
- July 2013 (1)
- May 2013 (1)
- April 2013 (3)
- March 2013 (2)
- January 2013 (2)
- December 2012 (2)
- November 2012 (4)
- October 2012 (3)
- August 2012 (4)
- July 2012 (5)
- June 2012 (1)
- March 2012 (1)
- January 2012 (1)
- November 2011 (4)
- October 2011 (3)
- September 2011 (2)
- August 2011 (2)
- July 2011 (2)
- June 2011 (1)
- May 2011 (6)
- April 2011 (2)
- March 2011 (1)
- February 2011 (3)
- January 2011 (1)
- December 2010 (2)
- November 2010 (3)
- October 2010 (1)
- September 2010 (1)
- August 2010 (3)
- July 2010 (2)
- June 2010 (3)
- May 2010 (3)
- April 2010 (3)
- March 2010 (2)
- February 2010 (1)
- January 2010 (1)
- December 2009 (2)
- October 2009 (3)
- September 2009 (2)
- August 2009 (4)
- July 2009 (7)
- June 2009 (1)
- May 2009 (2)
- April 2009 (1)
- March 2009 (2)
- February 2009 (3)
- January 2009 (3)
- December 2008 (2)
- September 2008 (2)
- August 2008 (1)
- July 2008 (3)
- June 2008 (1)
- April 2008 (4)
- March 2008 (4)
- February 2008 (4)
- January 2008 (2)
- December 2007 (4)
- October 2007 (2)
- September 2007 (2)
- August 2007 (3)
- June 2007 (2)

### Top Posts

### Blogroll

### Fun

### Personal

### Meta

# Category Archives: competitive programming

## Competitive programming in Haskell challenge: Letter Optimization

Now that I’ve wrapped up my series of posts on Infinite 2D Array (challenge, part 1, part 2, part 3), I’d like to tackle another topic related to competitive programming in Haskell. I won’t tell you what the topic is … Continue reading

## Competitive programming in Haskell: Infinite 2D array, Level 4

In a previous post, I challenged you to solve Infinite 2D Array using Haskell. After deriving a formula for that involves only a linear number of terms, last time we discussed how to efficiently calculate Fibonacci numbers and binomial coefficients … Continue reading

## Competitive programming in Haskell: Infinite 2D array, Levels 2 and 3

In a previous post, I challenged you to solve Infinite 2D Array using Haskell. As a reminder, the problem specifies a two-parameter recurrence , given by for for for . Last time, we derived a formula for that involves only … Continue reading

## Competitive programming in Haskell: better binary search

Binary search is a workhorse of competitive programming. There are occasional easy problems where binary search is the solution in and of itself; more often, it’s used as a primitive building block of more complex algorithms. It is often presented … Continue reading

## Competitive programming in Haskell: Infinite 2D array, Level 1

In my previous post, I challenged you to solve Infinite 2D Array using Haskell. As a reminder, the problem specifies a two-parameter recurrence , given by for for for . We are given particular values of and , and asked … Continue reading

## Competitive programming in Haskell: Infinite 2D array

If you like number theory, combinatorics, and/or optimizing Haskell code, I challenge you to solve Infinite 2D Array using Haskell. Level 1: can you come up with a general formula to compute ? Level 2: In general, how can you … Continue reading

## Competitive programming in Haskell: BFS, part 4 (implementation via STUArray)

In a previous post, we saw one way to implement our BFS API, but I claimed that it is not fast enough to solve Modulo Solitaire. Today, I want to demonstrate a faster implementation. (It’s almost certainly possible to make … Continue reading

Posted in competitive programming, haskell
Tagged BFS, graph, haskell, Kattis, mutable, search, STUArray
3 Comments

## Competitive programming in Haskell: Enumeration

I’m in the middle of a multi-part series on implementing BFS in Haskell. In my last post, we saw one implementation, but I claimed that it is not fast enough to solve Modulo Solitaire, and I promised to show off … Continue reading

Posted in competitive programming, haskell
Tagged enumeration, haskell, index, invertible, Kattis
1 Comment

## Competitive programming in Haskell: BFS, part 3 (implementation via HashMap)

In a previous post, I showed how we can solve Modulo Solitaire (and hopefully other BFS problems as well) using a certain API for BFS, and we also explored some alternatives. I had a very interesting discussion with Andrey Mokhov … Continue reading

Posted in competitive programming, haskell
Tagged BFS, graph, HashMap, haskell, Kattis, search
6 Comments

## Competitive programming in Haskell: BFS, part 2 (alternative APIs)

In my last post, I showed how we can solve Modulo Solitaire (and hopefully other BFS problems as well) using a certain API for BFS, which returns two functions: one, level :: v -> Maybe Int, gives the level (i.e. … Continue reading