Example 6 In a grid, three identical red cars and three identical black cars are parked, with one car in each row and each column, and each car occupies one cell. The number of ways to park the cars is ( ).
(A) 720
(B) 20
(C) 518400
(D) 14400
Problem 580
Official solution
Assume first that the three red cars are distinct and the three black cars are also distinct. The first car can obviously be placed in any of the 36 squares, giving 36 ways. The second car, which cannot be in the same row or column as the first car, has 25 ways to be placed.
Similarly, the third, fourth, fifth, and sixth cars have , , , and ways to be placed, respectively.
Noting that the three red cars are identical and the three black cars are also identical, we have
different ways. Therefore, the answer is (D).