Skip to content

Commit 144ad0e

Browse files
committed
p1990
1 parent d5855b7 commit 144ad0e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

misc/luogu/p1990.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ import (
66
)
77

88
// https://space.bilibili.com/206214
9-
type matrix [][]int
9+
type matrix1990 [][]int
1010

11-
func newMatrix(n, m int) matrix {
12-
a := make(matrix, n)
11+
func newMatrix1990(n, m int) matrix1990 {
12+
a := make(matrix1990, n)
1313
for i := range a {
1414
a[i] = make([]int, m)
1515
}
1616
return a
1717
}
1818

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]))
2121
for i, row := range a {
2222
for k, x := range row {
2323
if x == 0 {
@@ -31,7 +31,7 @@ func (a matrix) mul(b matrix) matrix {
3131
return c
3232
}
3333

34-
func (a matrix) powMul(n int, f matrix) matrix {
34+
func (a matrix1990) powMul(n int, f matrix1990) matrix1990 {
3535
res := f
3636
for ; n > 0; n /= 2 {
3737
if n%2 > 0 {
@@ -49,8 +49,8 @@ func p1990(in io.Reader, out io.Writer) {
4949
Fprint(out, 1)
5050
return
5151
}
52-
f2 := matrix{{2}, {1}, {1}}
53-
m := matrix{
52+
f2 := matrix1990{{2}, {1}, {1}}
53+
m := matrix1990{
5454
{2, 0, 1},
5555
{1, 0, 0},
5656
{0, 1, 0},

0 commit comments

Comments
 (0)