快速幂
忆昔,仰优
Accepted
展开
-
Recursive sequence
SDUT 2019 Autumn Team Contest 17th Farmer John likes to play mathematics games with his N cows. Recently, they are attracted by recursive sequences. In each turn, the cows would stand in a line, ...原创 2019-11-01 19:24:04 · 199 阅读 · 0 评论 -
斐波那契的矩阵快速幂
思路: 代码: #include <bits/stdc++.h> using namespace std; struct Matrix { int a[2][2]; }; Matrix mul(Matrix A,Matrix B) { Matrix C= {0,0, 0,0, }; in...原创 2019-10-22 22:38:23 · 123 阅读 · 0 评论 -
算法实力
一开始,一个人的算法实力是1,当他学会了一个难度值为x的算法的时候,因为两个算法是会产生灵感的,他的实力将变成之前的x倍。 现在alaikesitasa的算法实力是n,他说自己一直都在学同一种难度的算法并且学会了两个或更多,他说的是不是有可能是真的呢? 一个人学完算法之后实力一定会上升。 Input 第一行一个t t<=100代表数据组数 每一组一个n n<=1000000000 代表...原创 2019-08-14 15:22:33 · 96 阅读 · 0 评论