8. A grid with the following properties is called a "T-grid":
(1) Five cells are filled with 1, and four cells are filled with 0;
(2) Among the three rows, three columns, and two diagonals, at most one of these eight lines has three numbers that are pairwise equal.
Then the number of different T-grids is .
Problem 686
Official solution
8. 68.
First, the number of all ways to fill a grid with five 1s and four 0s is .
Next, consider the number of ways that do not satisfy property (2), i.e., methods that result in at least two lines of three equal numbers (hereafter referred to as good lines).
We will count these by categorizing them. Good lines can be rows, columns, or diagonals.
If the two good lines are both diagonals, then they are all 1s, with 1 method;
If the two good lines are both rows (or columns), then one row is filled with 0s and one row is filled with 1s, there are methods, by the symmetry of rows and columns, there are methods;
If the two good lines are one row and one column, in this case, the good lines are all 1s, there are methods;
If the two good lines are one row and one diagonal, in this case, the good lines are all 1s, there are methods;
If the two good lines are one column and one diagonal, in this case, the good lines are all 1s, there are methods.
Therefore, the number of methods that satisfy the property is