The 2023 ICPC Southeast USA Programming Contest was held on 24 February, 2024.
November 2nd, 2013 | Categories: 2013 Regionals

Here it is – the 2013 Southeast USA Regional Division 2 problem set. You can download the text from here.

Problem Judge Data Solutions
A: Cut the Cake

Submissions: 5
Solutions: 1
cake.judge
cake.solution
cake_vanb.java
CakeCutting_artur.java
CakeCutting_zeil.java
B: The n Days of Christmas

Submissions: 169
Solutions: 12
christmas.judge
christmas.solution
christmas_vanb.java
Christmas_artur.java
Christmas_Calvin.java
christmas_dennis_cin.cpp
C: Ping!

Submissions: 14
Solutions: 9
ping.judge
ping.solution
ping_vanb.java
Ping_artur.java
PING_Yan.py (See note below)
D: Electric Car Rally

Submissions: 0
Solutions: 0
rally.judge
rally.solution
rally_vanb.java
ElectricRally_artur.java
electricRally_zeil.cpp
E: Count your Cousins

Submissions: 12
Solutions: 5
cousins.judge
cousins.solution
cousins_vanb.java
Cousins_artur.java
F: Decimal Representation

Submissions: 2
Solutions: 1
decimal.judge
decimal.solution
decimal_vanb.java
Decimal_artur.java
decimal_dennis.cpp
G: Politics

Submissions: 46
Solutions: 12
politics.judge
politics.solution
politics_vanb.java
Politics_artur.java
Sort_Calvin.java
Sort_Slow_Calvin.java
H: Perfect Shuffle

Submissions: 69
Solutions: 38
shuffle.judge
shuffle.solution
shuffle_vanb.java
Shuffle_artur.java
Shuffle_Calvin.java
shuffle_dennis.cpp
I: Speed Can Cost You

Submissions: 125
Solutions: 29
speed.judge
speed.solution
speed_vanb.java
Speed_artur.java
Speed_Calvin.java
speed_dennis.cpp
SPEED_Yan.py (See note below)
J: Text Roll

Submissions: 94
Solutions: 31
textroll.judge
textroll.solution
textroll_vanb.java
Text_Roll_dennismv.cpp
TextRoll_artur.java
TextRoll_Calvin.java
textroll_dennis.cpp

Note: For security reasons, the blog won’t upload files with a “.py” extension. The Python programs have extension “.txt”, which will need to be changed to “.py”

May 28th, 2013 | Categories: 2013 UChicago Invitational

Here it is – the 2013 UChicago Invitational problem set. You can download the text from here.

Problem Judge Data Solutions
A: Winter Roads

Submissions: 8
Solutions: 1
bridges.judge
bridges.solution
bridges2_vanb.java
bridges_artur.java
B: Can of Worms

Submissions: 36
Solutions: 5
cans.judge
cans.solution
SolutionOne.java
SolutionTwo.java
solution.txt
C: Automatic Trading

Submissions: 36
Solutions: 18
trading.judge
trading.solution
automatictrading_artur.java
prefix.cpp
D: 3D Printer

Submissions: 11
Solutions: 10
threedprinter.judge
threedprinter.solution
threedprinter_vanb.java
threedprinter_topraj.java
3dprinter.cpp
E: Flooding Fields

Submissions: 42
Solutions: 10
floodingfields.judge
floodingfields.solution
floodingfields_vanb.java
floodingfields_artur.java
F: Goat Ropes

Submissions: 16
Solutions: 5
goatropes.judge
goatropes.solution
goatropes_vanb.java
goat.cpp
G: Job Postings

Submissions: 26
Solutions: 13
jobpostings.judge
jobpostings.solution
jobpostings_vanb.java
jobpostings_artur.java
H: Overlapping Maps

Submissions: 41
Solutions: 21
overlappingmaps.judge
overlappingmaps.solution
overlappingmaps_vanb.java
overlapingmaps_artur.java
maps.cpp
I: Unreal Estate

Submissions: 50
Solutions: 12
realestate.judge
realestate.solution
realestate_vanb.java
realeastate_artur.java
The program from vanb is O(n*n) and runs in contest time.The program from artur is O(n*n*log(n)). It generates correct answers, but runs too long.
J: Satisfaction Guaranteed

Submissions: 7
Solutions: 0
satisfaction.judge
satisfaction.solution
satisfactionguaranteed_vanb.java
sat.cpp
K: Uniform Subtrees

Submissions: 15
Solutions: 4
uniform.judge
uniform.solution
uniformsubtrees_vanb.java
uniformsubtree_topraj_sortedints.java
March 31st, 2013 | Categories: 2013 UChicago Invitational

A Russian contest is going to use this problem set in about a week, so we can’t post the data to the public just yet. I’ll post the usual problem breakdown in about a week, but for now, here’s the problem set & data for the UChicago 2013 Invitational contest. The data is encrypted and password protected, so that only participants can see it.

Problem set: UChicago Invitational 2012 Problem Set

Data: data

November 10th, 2012 | Categories: 2012 Regionals

Here it is – the 2012 Division II problem set. You can download the text from here.

Problem Judge Data Solutions
A: Candy Store

Our Rating: C/D
Submissions: 27
Solutions: 1
candystore.judge
candystore.solution
candystore.java
candy_memo.cpp
CandyStore_jbrodie.hs
B: Collision Detection

Our Rating: C/D
Submissions: 16
Solutions: 0
collisiondetection.judge
collisiondetection.solution
collisiondetection2.java
collision_chinmay.cpp
CollisionDetection_zeil.java
C: Do It Wrong, Get It Right

Our Rating: C/D
Submissions: 15
Solutions: 0
doitwrong.judge
doitwrong.solution
doitwrong.java
DOIT_WRONG.cpp
doitwrong.cpp
D: Dueling Philosophers

Our Rating: A/B
Submissions: 11
Solutions: 1
duelingphilosophers.judge
duelingphilosophers.solution
duelingphilosophers.java
DUEL_PHIL.cpp
DuelingPhilosophers_jbrodie.java
DuelingPhilosophers_zeil_SERpatchedBy_jbrodie.java
E: Paint Me

Our Rating: A/B
Submissions: 90
Solutions: 41
paintme.judge
paintme.solution
paintme.java
paintMe_zeil.cpp
F: Party Games

Our Rating: A/B
Submissions: 93
Solutions: 1
partygames.judge
partygames.solution
partygames.java
PARTY.py
partyGames_zeil.cpp
G: Reverse Nonogram

Our Rating: A/B
Submissions: 58
Solutions: 28
reversenonogram.judge
reversenonogram.solution
reversenonogram.java
REV_NONO.cpp
H:Tsunami

Our Rating: C/D
Submissions: 27
Solutions: 0
tsunami.judge
tsunami.solution
tsunami.java
tsunami.cpp
Tsunami_zeil.java
I: Unhappy Numbers

Our Rating: C/D
Submissions: 44
Solutions: 0
unhappy.judge
unhappy.solution
unhappy.java
unhappy.cpp
UNHAPPY.py
J: Walls

Our Rating: C/D
Submissions: 0
Solutions: 0
walls.judge
walls.solution
walls.java
WALLS.cpp
November 10th, 2012 | Categories: 2012 Regionals

Here it is – the 2012 Division I problem set. You can download the text from here.

Problem Judge Data Solutions
A: Candy Store

Our Rating: C/D
Submissions: 108
Solutions: 30
candystore.judge
candystore.solution
candystore.java
candy_memo.cpp
CandyStore_jbrodie.hs
B: Collision Detection

Our Rating: C/D
Submissions: 48
Solutions: 4
collisiondetection.judge
collisiondetection.solution
collisiondetection2.java
collision_chinmay.cpp
CollisionDetection_zeil.java
C: Component Testing

Our Rating: E/F
Submissions: 24
Solutions: 1
componenttesting.judge
componenttesting.solution
componenttesting3.java
ComponentChecking_zeil.cpp
ComponentTesting_chinmay.cpp
ComponentTesting_jbrodie.hs
YiuComponentsTesting.java
analysis.txt
D: Do It Wrong, Get It Right

Our Rating: C/D
Submissions: 139
Solutions: 25
doitwrong.judge
doitwrong.solution
doitwrong.java
DOIT_WRONG.cpp
doitwrong.cpp
E: Funhouse

Our Rating: E/F
Submissions: 4
Solutions: 0
funhouse.judge
funhouse.solution
funhouse.java
FunHouse_zeil.java
F: A Terribly Grimm Problem

Our Rating: E/F
Submissions: 56
Solutions: 5
grimm.judge
grimm.solution
grimm.java
Grimm_jbrodie.java
Grimm_jbrodie_another.hs
Grimm_zeil.java
G: Heads or Tails

Our Rating: E/F
Submissions: 3
Solutions: 0
headsortails.judge
headsortails.solution
headsortails.java
HOT.cpp
NOFP.py
H:Tsunami

Our Rating: C/D
Submissions: 81
Solutions: 13
tsunami.judge
tsunami.solution
tsunami.java
tsunami.cpp
Tsunami_zeil.java
I: Unhappy Numbers

Our Rating: C/D
Submissions: 61
Solutions: 8
unhappy.judge
unhappy.solution
unhappy.java
unhappy.cpp
UNHAPPY.py
J: Walls

Our Rating: C/D
Submissions: 22
Solutions: 4
walls.judge
walls.solution
walls.java
WALLS.cpp
May 14th, 2012 | Categories: North America Super-Region

This post is for general discussion of the organization of the North American Super-Region, and questions of how the super-regional organization might be changed to encourage more participation, give more teams a next-level contest experience, and improve North American performance.

April 15th, 2012 | Categories: 2012 UChicago Invitational

Here it is – the problem set. You can download the text from here.

Problem Judge Data Solutions
A: CosmoCraft

Submissions: 0
Solutions: 0
cosmo.in
cosmo.out
cosmo.cpp
Cosmo.java
B: Covered Walkway

Submissions: 34
Solutions: 6
covered.zip
covered.out
covered.java
coverage.cpp
C: Double Dealing

Submissions: 78
Solutions: 17
doubledealing.in
doubledealing.out
doubledealing.java
double.cpp
D: The End of the World

Submissions: 38
Solutions: 21
theend.in
theend.out
theend.java
EndOfWorld.java
E: Estimation

Submissions: 42
Solutions: 12
estimate.in
estimate.out
estimate.java
estimation.cpp
F: Juggler

Submissions: 51
Solutions: 17
juggler.in
juggler.out
juggler.java
juggler.cpp
G: Red/Blue Spanning Tree

Submissions: 42
Solutions: 13
redblue.in
redblue.out
redblue.java
RedBlue.java
H:The Red Gem

Submissions: 25
Solutions: 6
redgem.in
redgem.out
redgem.java
RedGem.java
I: Science!

Submissions: 33
Solutions: 8
science.in
science.out
science.checker.cpp
science.java
science.cpp
J: The Worm in the Apple

Submissions: 3
Solutions: 3
worm.in
worm.out
worm.java
worm.cpp
November 20th, 2011 | Categories: 2011 Regionals

Here is a video of a webcast of the Chief Judge (me) discussing each of the problems in the 2011 problem set. The original lecture was given at Georgia Tech on Thursday, 11 November. The video is about 90 minutes long. The real content starts at about the 2 minute mark.

[flv:http://vanb.org/ser2011/vanb_ser2011_lecture.flv X 640 480]

Problem Approximate time it starts
Sunday Drive 4:00
Hexagram 9:00
Flooring Tiles 14:30
Vive la Difference! (Proof of 3n convergence) 27:00
Robot Navigation 41:45
Folding Game 49:45
Burnout 52:45
Family Fortune 63:55
Moving Points 73:00
Vampire Numbers 81:35
November 2nd, 2011 | Categories: 2011 Regionals

In the problem statement for Vive la Difference, we make the claim that if all four numbers are less than 2^n, then it will converge in no more than 3n steps. This PowerPoint presentation outlines a proof.

October 29th, 2011 | Categories: 2011 Regionals

Here it is – the 2011 problem set. You can download the text from here.

Problem Judge Data Solutions
A: Sunday Drive

Our Rating: C/D
Submissions: 43
Solutions: 14
sundaydrive.judge
sundaydrive.solution
sundaydrive.java
B: Hexagram

Our Rating: C/D
Submissions: 13
Solutions: 8
hexagram.judge
hexagram.solution
hexagram.java
C: Flooring Tiles

Our Rating: C/D
Submissions: 35
Solutions: 9
flooringtiles.judge
flooringtiles.solution
flooringtiles.java
D: Vive la Difference!

Our Rating: A/B
Submissions: 102
Solutions: 78
difference.judge
difference.solution
difference.java
E: Robot Navigation

Our Rating: C/D
Submissions: 16
Solutions: 7
robotnavigation.judge
robotnavigation.solution
robotnavigation.java
F: Folding Game

Our Rating: E/F
Submissions: 14
Solutions: 2
folding.judge
folding.solution
folding.java
G: Burnout

Our Rating: C/D
Submissions: 85
Solutions: 0
burnout.judge
burnout.solution
burnout.java
H:Family Fortune

Our Rating: E/F
Submissions: 3
Solutions: 0
family.judge
family.solution
family.java
I: Moving Points

Our Rating: E/F
Submissions: 4
Solutions: 2
movingpoints.judge
movingpoints.solution
movingpoints.java
J: Vampire Numbers

Our Rating: A/B
Submissions: 86
Solutions: 30
vampirenumbers.judge
vampirenumbers.solution
vampirenumbers.java

sundaydrive.java

June 25th, 2011 | Categories: 2011 Regionals

Here’s the Call for Problems that was recently sent out to all SER coaches and Problem Selection Committee members:

Summer is upon us, World Finals is over, so it’s time to start thinking, just a little bit, about the Southeast USA Regional Programming Contest. It’ll be a little bit earlier this year, on Saturday, 29 October. So, spend your summer dreaming up programming problems! Also, we’re looking for people to serve on the Problem Selection Committee. Putting together the problem set for SER is an intense, rewarding process. If you’re interested, send me an e-mail (at vanb@biltmorecomm.com).

As usual, the Problem Selection Committee will be responsible for putting the problem set together. The PSC will also be responsible for judging, so problem providers won’t have to judge. Because of this, you can provide a problem, and also coach your team, and attend the contest with them at your chosen site. Anyone can submit a problem for consideration – however, although a problem submitter can also act as a coach, they cannot be a contestant, whether or not their problem is chosen for the set. In other words, if a student submits a problem, they are ineligible to compete.

Candidate problems should be e-mailed to me (at vanb@biltmorecomm.com). A statement of the problem is all that’s necessary, either in text or in MS Word format (right in the e-mail is fine). If you wish to include a solving program and/or test data, that’s very, very helpful, but not necessary. If you have a rough idea and want to talk about it, feel free to e-mail it to me, and I’ll be happy to work with you.

Problems should be sent by Friday, 9 September to be eligible for consideration. That’s the Friday after Labor Day. I’ll remind you again, but I’m sending out the call for problems early, to get you thinking!

Below you will find an excerpt from the Call for Problems issued from World Finals this year. It’s a good set of guidelines for candidate problems. If you are thinking of submitting a candidate problem for Southeast Regionals, you should read through it. I will add a couple of constraints of my own:

  1. The problem should be original. It should not be a restatement of a problem that has been used previously in the Southeast USA, or any other ICPC regional, World Finals, or other contest environment such as TopCoder or Google CodeJam. It also should not come from a book, such as “Programming Challenges.” If it has its own Wikipedia page, then it’s too well-known.
  2. The output for any given input should be unique. Try to add constraints to your problem so that there is exactly one answer for each input case.

Don’t forget about the blog to talk about judging at our contest. It’s at:

http://serjudging.vanb.org

Feel free to drop by and give suggestions – however, do NOT post candidate problems on this site. It is open to everyone, including students. Any problem posted on the site cannot be used in the contest.

————- Some excerpts from the World Finals call for problems: ————-

Problem Statements

  1. Each problem must be unambiguously described in English.
  2. All problems must require input.
  3. Unless the core of the problem is input/output related, the formats chosen for input data and the displayed results should be relatively simple. Still, the format of the input data and the appearance of the expected displayed results must be described in suitable detail.
  4. Multiple data sets testing different cases are appropriate; make the problem statement include iterative data sets as input to avoid using separate input files.
  5. Anticipate questions about special cases. Where appropriate, explicitly state that certain special cases will not appear in the input data. It is not necessary to specifically identify the special cases that will appear.
  6. Indicate the precision that is required for real results.
  7. Contestants must write solutions for problems in a short time. While very simple problems are not appropriate, neither are problems that require a great deal of code; a few hundred lines of Java or C should be an upper limit on what can be expected in a solution.
  8. The program and chosen test data should not require excessive execution time. Contestants’ solutions may be less efficient than yours and so a generous margin is allowed for execution. If your test data requires the program to execute for a long time, then incorrect student solutions (e.g., those with infinite loops) will take an excessively long time to judge. We would like to avoid those situations.
  9. The problem description (excluding sample input/output) should generally require at most one page.

Submission of Problems, Solutions, and Test Data

  1. Use electronic mail and send all files as either MS Word document, or flat ASCII.
  2. Do not put your name in documents, or the body of e-mails, containing the problem statement, solution, or test data. This will simplify the transformation from your form to the one used for ranking.
  3. Be discreet about problem statements and solutions. It is not appropriate to discuss problems with people not involved with the contest.
May 31st, 2011 | Categories: Topics from 2011 RCD meeting

This post is to discuss our outreach to schools that are not currently participating in regionals. More content forthcoming, as soon as the minutes are available.

May 31st, 2011 | Categories: Topics from 2011 RCD meeting

This post is to discuss our outreach to high schools and high school students. More content forthcoming, as soon as the minutes are available.

May 31st, 2011 | Categories: Topics from 2011 RCD meeting

This post is to discuss how to allocate wildcards in the North America super-region, including such methods as regular or random distribution among regionals, or a super-regional. More content forthcoming, as soon as the minutes are available.

May 31st, 2011 | Categories: Topics from 2011 RCD meeting

This post is to discuss additional tiers in our contests, particularly getting credit for local contests that schools are already running. This is about tiers below regionals. Tiers above regionals (i.e. a “super-regional”) will be covered in the Wildcards post. More content forthcoming, as soon as the minutes are available.

May 31st, 2011 | Categories: Topics from 2011 RCD meeting

This post is to discuss additional awards that might be given at regional contests to encourage participation. More content forthcoming, as soon as the minutes are available.

May 31st, 2011 | Categories: Topics from 2011 RCD meeting

This post is to discuss additional activities at regional contests. More content forthcoming, as soon as the minutes are available.

November 6th, 2010 | Categories: 2010 Regionals

Here it is – the 2010 problem set. You can download the text from here.

Problem Judge Data Solutions
A: Balloons

Our Rating:
Submissions:
Solutions:
balloons.judge
balloons.solution
B: Bit Counting

Our Rating:
Submissions:
Solutions:
bitcounting.judge
bitcounting.solution
C: Data Recovery

Our Rating:
Submissions:
Solutions:
datarecovery.judge
datarecovery.solution
D: Equal Angles

Our Rating:
Submissions:
Solutions:
equalangles.judge
equalangles.solution
E: Maximum Square

Our Rating:
Submissions:
Solutions:
maximumsquare.judge
maximumsquare.solution
F: Palindrometer

Our Rating:
Submissions:
Solutions:
palindrometer.judge
palindrometer.solution
G: Profits

Our Rating:
Submissions:
Solutions:
profits.judge
profits.solution
Note: The judge input has some blank lines in it. This is an artifact of the upload to the blog. The version used for judging does not have them. I will upload the good version as soon as I can.
H: Roller Coaster

Our Rating:
Submissions:
Solutions:
rollercoaster.judge
rollercoaster.solution
I: Skyline

Our Rating:
Submissions:
Solutions:
skyline.judge
skyline.solution
J: Underground Cables

Our Rating:
Submissions:
Solutions:
undergroundcables.judge
undergroundcables.solution
June 13th, 2010 | Categories: 2010 Regionals

The Southeast USA Regional Programming Contest will be held on Saturday 6 November this year, and I will once again be Chief Judge.

As usual, the Problem Selection Committee will be responsible for putting the problem set together. The PSC will also be responsible for judging, so problem providers won’t have to judge. Because of this, you can provide a problem, and also coach your team, and attend the contest with them at your chosen site. Anyone can submit a problem for consideration – however, although a problem submitter can also act as a coach, they cannot be a contestant, whether or not their problem is chosen for the set. In other words, if a student submits a problem, they are ineligible to compete.

Candidate problems should be e-mailed to me (at vanb@vanb.org). A statement of the problem is all that’s necessary, either in text or in MS Word format (right in the e-mail is fine). If you wish to include a solving program and/or test data, that’s very, very helpful, but not necessary. If you have a rough idea and want to talk about it, feel free to e-mail it to me, and I’ll be happy to work with you.

Problems should be sent by 13 September to be eligible for consideration. I’ll remind you again, but I’m sending out the call for problems early, to get you thinking!

Below you will find an excerpt from the Call for Problems issued from World Finals this year. It’s a good set of guidelines for candidate problems. If you are thinking of submitting a candidate problem for Southeast Regionals, you should read through it. I will add a couple of constraints of my own:

  1. The problem should be original. It should not be a restatement of a problem that has been used previously in the Southeast USA, or any other ICPC regional, World Finals, or other contest environment such as TopCoder or Google CodeJam. It also should not come from a book, such as “Programming Challenges.” If it has its own Wikipedia page, then it’s too well-known.
  2. The output for any given input should be unique. Try to add constraints to your problem so that there is exactly one answer for each input case.

Based on suggestions from last year’s regional contest, I have started a blog to talk about judging at our contest. It’s at:

http://serjudging.vanb.org

Feel free to drop by and give suggestions – however, do NOT post candidate problems on this site. It is open to everyone, including students. Any problem posted on the site cannot be used in the contest.

————- Some excerpts from the World Finals call for problems: ————-

Problem Statements

  1. Each problem must be unambiguously described in English.
  2. All problems must require input.
  3. Unless the core of the problem is input/output related, the formats chosen for input data and the displayed results should be relatively simple. Still, the format of the input data and the appearance of the expected displayed results must be described in suitable detail.
  4. Multiple data sets testing different cases are appropriate; make the problem statement include iterative data sets as input to avoid using separate input files.
  5. Anticipate questions about special cases. Where appropriate, explicitly state that certain special cases will not appear in the input data. It is not necessary to specifically identify the special cases that will appear.
  6. Indicate the precision that is required for real results.
  7. Contestants must write solutions for problems in a short time. While very simple problems are not appropriate, neither are problems that require a great deal of code; a few hundred lines of Java or C should be an upper
    limit on what can be expected in a solution.
  8. The program and chosen test data should not require excessive execution time. Contestants’ solutions may be less efficient than yours and so a generous margin is allowed for execution. If your test data requires the program to execute for a long time, then incorrect student solutions (e.g., those with infinite loops) will take an excessively long time to judge. We would like to avoid those situations.
  9. The problem description (excluding sample input/output) should generally require at most one page.

Submission of Problems, Solutions, and Test Data

  1. Use electronic mail and send all files as either MS Word documents, or flat ASCII.
  2. Do not put your name in documents, or the body of e-mails, containing the problem statement, solution, or test data. This will simplify the transformation from your form to the one used for ranking.
  3. Be discreet about problem statements and solutions. It is not appropriate to discuss problems with people not involved with the contest.
March 28th, 2010 | Categories: 2009 Regionals

We considered this problem an E/F, World-Finals level of difficulty. There were 3 correct solutions – on only 7 submissions, and the first came only 65 minutes into the contest. It had the highest solution percentage of any problem outside of the two A/Bs (Knitting and Minesweeper). That means that few teams knew how to solve it, and few tried, but those who knew it, knew it well, and got it quickly and accurately.

Take a look at the Judge Input, the Judge Output, the main Solving Program, and another java solution.

A solution is in the spoiler.

[spoiler]
The key to understanding this solution is to see a column of the mosaic as a bitmap – with the bit set (=1) if there’s a tile there, and unset (=0) if not. Since there are at most 10 rows, that gives us 1024 possible bitmaps, which is manageable.

Try to build a Mosaic, column by column. Since the pieces are 2×2, you can’t fill a column without leaving some residue in the next column. So, you need to figure out, for any bitmap j representing a residue from the last column, how many ways can we fill this column and leave a residue of bitmap k in the next column? The following picture illustrates one way of filling 1001101001 (617) and ending up with 1111011110 (990).

Here’s an interesting thing – that depends only on the number of rows. So, you can compute all of that a priori, before you start reading the data, rather than doing it over and over for each data set. A recursive algorithm will do the trick.

Once you’ve got that computed, then for each input, you need to fill the columns so that you start with a bitmap of 0 (on the edge, no residue), go through m columns, and end up with a bitmap of 0 (no residue – nothing hanging off the edge of the mosaic)

     
// Assume n rows and m columns.
// Let p be the number of bitmaps if there are n rows.
// So, p = 2^n, or 1<<n
int p = 1<<n;
       
// Let next[k] be the number of ways of achieving bitmap k
// on the next column
int next[] = new int[p];

// We'll start at the very beginning (a very good place to start)
// with one bitmap of 0, and no others.
next[0] = 1;

// Go through all of the columns
for( int i=0; i<m; i++ )
{
    // Swap current and next - last iterations' next[]
    // is this iteration's current[]
    int temp[] = current;
    current = next;
    next = temp;
            	
    // Start afresh
    Arrays.fill( next, 0 );
            	
    // Go through all possible bitmaps.
    for( int j=0; j<p; j++ ) if( current[j]>0 ) for( int k=0; k<p; k++  )
    {
        // Assume that ways[n][j][k] is the number of ways of getting from 
        // bitmap j to bitmap k if there are n rows. (In the actual code, a linked list 
        // is used for efficiency, since this matrix will be sparse.)
        //
        // If there are current[j] ways of getting to bitmap j on the current column,
        // and ways[n][j][k] ways of getting from there to bitmap k, then we've
        // just found current[j]*ways[n][j][k] more ways of getting to bitmap k
        // on the next column. So, add them in.
        next[k] += current[j] * ways[n][j][k];

        // Mod to keep the numbers manageable.
        next[k] %= 1000000;
    }
}

// We're done! How many ways were there of achieving bitmap 0
// on the last iteration - that is, we nicely filled in the mosaic with
// nothing hanging over?
System.out.println( next[0] );

[/spoiler]