全部评论 3

  • 你说得对,但是真正需要这个题解的地方在绿题

    2024-08-13 来自 湖南

    0
    • 你说得对,但是这是一篇乐子题解

      2024-08-13 来自 浙江

      0
    • 桂霞😡😡😡

      2024-08-13 来自 湖南

      0
    • 在吗,帮我看看我的矩阵为什么错(链接

      #include <iostream>
      #include <cstdio>
      #define int unsigned long long
      using namespace std;
      const int mod = 1e9+7;
      struct node{
      	int fib[2][2] = {{0, 0}, {0, 0}};
      	node operator * (const node &b) const{
      		node temp;
      		for(int i = 0; i < 2; i++){
      			for(int j = 0; j < 2; j++){
      				for(int k = 0; k < 2; k++) temp.fib[i][j] = (temp.fib[i][j] + fib[i][k] * b.fib[k][j] % mod) % mod;
      			}
      		}return temp;
      	} 
      }a, b;
      signed main(){
      	a.fib[0][0] = a.fib[1][0] = a.fib[0][1] = 1;
          b.fib[0][0] = b.fib[1][1] = 1;
      	int n;
      	cin >> n;
          for(int i = 1; i <= n; i++){
              b = b * a;
          }
          
      	cout << b.fib[0][1];
      
      	return 0;
      }
      

      2024-08-15 来自 湖南

      0
  • 6

    2024-07-16 来自 广东

    0
  • d

    2024-06-22 来自 上海

    0
首页