File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,18 @@ import (
6
6
)
7
7
8
8
// https://space.bilibili.com/206214
9
- type matrix [][]int
9
+ type matrix1990 [][]int
10
10
11
- func newMatrix (n , m int ) matrix {
12
- a := make (matrix , n )
11
+ func newMatrix1990 (n , m int ) matrix1990 {
12
+ a := make (matrix1990 , n )
13
13
for i := range a {
14
14
a [i ] = make ([]int , m )
15
15
}
16
16
return a
17
17
}
18
18
19
- func (a matrix ) mul (b matrix ) matrix {
20
- c := newMatrix (len (a ), len (b [0 ]))
19
+ func (a matrix1990 ) mul (b matrix1990 ) matrix1990 {
20
+ c := newMatrix1990 (len (a ), len (b [0 ]))
21
21
for i , row := range a {
22
22
for k , x := range row {
23
23
if x == 0 {
@@ -31,7 +31,7 @@ func (a matrix) mul(b matrix) matrix {
31
31
return c
32
32
}
33
33
34
- func (a matrix ) powMul (n int , f matrix ) matrix {
34
+ func (a matrix1990 ) powMul (n int , f matrix1990 ) matrix1990 {
35
35
res := f
36
36
for ; n > 0 ; n /= 2 {
37
37
if n % 2 > 0 {
@@ -49,8 +49,8 @@ func p1990(in io.Reader, out io.Writer) {
49
49
Fprint (out , 1 )
50
50
return
51
51
}
52
- f2 := matrix {{2 }, {1 }, {1 }}
53
- m := matrix {
52
+ f2 := matrix1990 {{2 }, {1 }, {1 }}
53
+ m := matrix1990 {
54
54
{2 , 0 , 1 },
55
55
{1 , 0 , 0 },
56
56
{0 , 1 , 0 },
You can’t perform that action at this time.
0 commit comments