Skip to content

Commit d3e0308

Browse files
committed
modify code
1 parent 6a3c75c commit d3e0308

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

src/class098/Code02_FibonacciNumber.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public static int fib2(int n) {
3636
return m[0][0];
3737
}
3838

39+
// 矩阵快速幂
3940
public static int[][] power(int[][] m, int p) {
4041
int n = m.length;
4142
int[][] ans = new int[n][n];
@@ -51,6 +52,8 @@ public static int[][] power(int[][] m, int p) {
5152
return ans;
5253
}
5354

55+
// 矩阵相乘
56+
// a的列数一定要等于b的行数
5457
public static int[][] multiply(int[][] a, int[][] b) {
5558
int n = a.length;
5659
int m = b[0].length;

src/class098/Code03_ClimbingStairs.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public static int climbStairs(int n) {
2222
return m[0][0] + m[1][0];
2323
}
2424

25+
// 矩阵快速幂
2526
public static int[][] power(int[][] m, int p) {
2627
int n = m.length;
2728
int[][] ans = new int[n][n];
@@ -37,6 +38,8 @@ public static int[][] power(int[][] m, int p) {
3738
return ans;
3839
}
3940

41+
// 矩阵相乘
42+
// a的列数一定要等于b的行数
4043
public static int[][] multiply(int[][] a, int[][] b) {
4144
int n = a.length;
4245
int m = b[0].length;

src/class098/Code04_TribonacciNumber.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public static int tribonacci(int n) {
2424
return m[0][0] + m[1][0];
2525
}
2626

27+
// 矩阵快速幂
2728
public static int[][] power(int[][] m, int p) {
2829
int n = m.length;
2930
int[][] ans = new int[n][n];
@@ -39,6 +40,8 @@ public static int[][] power(int[][] m, int p) {
3940
return ans;
4041
}
4142

43+
// 矩阵相乘
44+
// a的列数一定要等于b的行数
4245
public static int[][] multiply(int[][] a, int[][] b) {
4346
int n = a.length;
4447
int m = b[0].length;

src/class098/Code05_DominoTromino.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public static int f2(int n) {
6262
return (int) ans;
6363
}
6464

65+
// 矩阵快速幂
6566
public static int[][] power(int[][] m, int p) {
6667
int n = m.length;
6768
int[][] ans = new int[n][n];
@@ -77,6 +78,8 @@ public static int[][] power(int[][] m, int p) {
7778
return ans;
7879
}
7980

81+
// 矩阵相乘
82+
// a的列数一定要等于b的行数
8083
public static int[][] multiply(int[][] a, int[][] b) {
8184
int n = a.length;
8285
int m = b[0].length;

src/class098/Code06_CountVowelsPermutation.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public static int countVowelPermutation(int n) {
3535
return (int) ans;
3636
}
3737

38+
// 矩阵快速幂
3839
public static int[][] power(int[][] m, int p) {
3940
int n = m.length;
4041
int[][] ans = new int[n][n];
@@ -50,6 +51,8 @@ public static int[][] power(int[][] m, int p) {
5051
return ans;
5152
}
5253

54+
// 矩阵相乘
55+
// a的列数一定要等于b的行数
5356
public static int[][] multiply(int[][] a, int[][] b) {
5457
int n = a.length;
5558
int m = b[0].length;

src/class098/Code07_StudentAttendanceRecordII.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static int checkRecord(int n) {
3737
return (int) (sum % MOD);
3838
}
3939

40+
// 矩阵快速幂
4041
public static int[][] power(int[][] m, int p) {
4142
int n = m.length;
4243
int[][] ans = new int[n][n];
@@ -52,6 +53,8 @@ public static int[][] power(int[][] m, int p) {
5253
return ans;
5354
}
5455

56+
// 矩阵相乘
57+
// a的列数一定要等于b的行数
5558
public static int[][] multiply(int[][] a, int[][] b) {
5659
int n = a.length;
5760
int m = b[0].length;

0 commit comments

Comments
 (0)