ACSL 2008/09 Contest #3 Senior Division

ACSL Blokus (Senior)

Blokus is an abstract strategy board game for two to four players, invented by Bernard Tavitian and first released in 2000 by Sekkoïa, a French company. The ACSL version of the game is played on a square board divided into 10 rows and 10 columns. Rows are labeled A - J and columns 1 - 10. Pieces made of square tiles are used.

The following pieces will be used:

PIECE APIECE BPIECE CPIECE D
12
12
 3
 1 
234
 1
23
4 

The object of the game is to place the pieces corner-to-corner on the board. Edges cannot touch. Tiles cannot overlap. All pieces must fit on the board. A clock-wise rotation amount for all pieces of 0, 90, 180, or 270 degrees is allowed. In the rotation tile 1 is always the pivot tile. The 3 diagrams below show the rotations of piece A with tile #1 placed at location B3.

90 degrees180 degrees270 degrees
 1234
C        
B     1  
A     2  
 1234
C        
B   2 1  
A        
 1234
C     2  
B     1  
A        

Input

There will be 5 lines of input. Each line will contain:
  1. A 2-character starting location in row-column order for piece A. Example: C2 tells you to put tile #1 of piece A at location C2.
  2. A rotation amount for piece A. In the rotation tile #1 is always the fixed pivot tile. Tile 1 does not change its location in any rotation.
  3. A tile number for piece A. Example: Since piece A is made with just 2 tiles, this tile number will be a 1 or a 2.
  4. A second tile number to be used with all 4 tiles. This is the tile number that will be used to link with piece A.

Sample Input #1 tells you to go to location row F-column 4 and place tile #1 of piece A rotated 0 degrees at that location. Using just tile #2 of piece A, try to place all of the pieces corner-tocorner with it using tile #1 of the other pieces as the link point. Shown are some examples of the pieces connecting with various rotations.

    2                
    1                
1 2             1 2  
    1       1 2   3  
    2           1 2  
                  3  
                     
1 2             4 3 2
    1             1  
  3 2         1 2    
                     

Output

For each input, print the total number of ways the rotated tile pieces fit corner-tocorner at the given tile number of piece A. If no piece will fit, then print NONE.

Sample Input

Note: only 4 cases are shown below
F4 0 2 1
J1 90 2 2
A4 180 1 4
C2 270 2 3

Sample Output

16
6
4
3

All Submissions
Best Solutions


Point Value: 10 (partial)
Time Limit: 2.00s
Memory Limit: 16M
Added: Mar 16, 2009

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

This time, we only got the program for our division.

Same basic idea.

Four items are given per testcase
1. A 2-character string representing where to place tile 1 of the first piece.
2. The rotation amount for the first piece (yes, the first piece may be rotated before being placed), in degrees clockwise. This will always be 0, 90, 180, or 270.
3. The linking tile number for the first piece.
4. The linking tile number for the second piece.
There are four pieces:
 
A B C D

12 12 1 1
3 234 23
4

All of these pieces may be rotated by any multiple of 90 degrees. Output the total number of different ways to place a second piece, considering all possible pieces, positions, and rotations.

Hopefully, someone will eventually become not lazy and will put the problem statements for this, Pinochle, and Bridge up on the judge.