斐波那契+质因数分解
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; <<; int n,answer,s; struct Node { ][]; Node(){memset(m,,sizeof(m));} }mb,ans; Node operator*(Node a,Node b) { Node c; ;i<=;i++) ;j<=;j++) ;k<=;k++) c.m[i][j]=(c.m[i][j]%mod+a.m[i][k]*b.m[k][j]%mod)%mod; return c; } int read() { ,f=; char ch=getchar(); ;ch=getchar();} +ch-',ch=getchar(); return x*f; } int main() { n=read(); ans.m[][]=ans.m[][]=; mb.m[][]=mb.m[][]=mb.m[][]=; while(n) { ) ans=ans*mb; mb=mb*mb;n>>=; } answer=ans.m[][]; printf("%d=",answer); ;i<=answer;i++) { ) { s++;answer/=i; ) printf("*"); printf("%d",i); } } ; }