File tree Expand file tree Collapse file tree 1 file changed +0
-5
lines changed
src/main/java/g1901_2000/s1931_painting_a_grid_with_three_different_colors Expand file tree Collapse file tree 1 file changed +0
-5
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,12 @@ public int colorTheGrid(int m, int n) {
2121 if (n == 2 ) {
2222 return (int ) (6L * powMod (3 , m - 1 ) % P );
2323 }
24-
2524 int totalTemplates = 1 << (m - 2 );
2625 int totalPaintings = binPow (3 , m );
27-
2826 int [] paintingToTemplate = new int [totalPaintings ];
2927 long [] paintingCountForTemplate = new long [totalTemplates ];
3028 long [][] templateEdgeCount = new long [totalTemplates ][totalTemplates ];
31-
3229 Map <Integer , Integer > templateToIndex = new HashMap <>(1 << (m - 2 ));
33-
3430 int templateCounter = 0 ;
3531 for (int i = 0 ; i < totalPaintings ; i ++) {
3632 int type = getType (i , m );
@@ -66,7 +62,6 @@ public int colorTheGrid(int m, int n) {
6662 templateEdgeCount [i ][j ] /= c ;
6763 }
6864 }
69-
7065 long [][] matrixPower = matrixPower (templateEdgeCount , (long ) n - 1 );
7166 long ans = 0 ;
7267 for (int i = 0 ; i < totalTemplates ; i ++) {
You can’t perform that action at this time.
0 commit comments