随笔分类 -  数论:矩阵快速幂

摘要:【解题思路】 给一张神图,推理写的灰常明白了,关键是构造共轭函数,这一点实在是要有数学知识的理论基础,推出了递推式,接下来就是矩阵的快速幂了。 神图: 给个大神的链接:构造类斐波那契数列的矩阵快速幂 /* * Problem: HDU No.4565 * Running time: 62MS * C 阅读全文
posted @ 2019-01-17 17:06 DWVictor 阅读(302) 评论(0) 推荐(0)
摘要:https://ac.nowcoder.com/acm/contest/338/L 题解: 当n==1时,0-9填上的话,对4取余,分别是余数为0的3个,1的3个,2的2个,3的2个; 当n==2时,因为一个数的时候有3323的余数个数分布,如果第2个填上数可以使原来的余数变成0或者保持零,那么可以 阅读全文
posted @ 2019-01-16 18:28 DWVictor 阅读(343) 评论(0) 推荐(0)
摘要:一、基础知识(1)矩阵乘法 https://blog.csdn.net/weixin_43272781/article/details/82899737 简单的说矩阵就是二维数组,数存在里面,矩阵乘法的规则:A*B=C 其中c[i][j]为A的第i行与B的第j列对应乘积的和,即: 代码: 另一种写法 阅读全文
posted @ 2019-01-16 18:26 DWVictor 阅读(467) 评论(0) 推荐(0)
摘要:H. Special Palindrome time limit per test:1 second memory limit per test:64 megabytes input:standard input output:standard output A sequence of positi 阅读全文
posted @ 2019-01-08 10:44 DWVictor 阅读(286) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/338/L来源:牛客网 Consider digits strings with length n, how many different strings have the sum of digits are multip 阅读全文
posted @ 2019-01-06 19:36 DWVictor 阅读(406) 评论(0) 推荐(0)