ACM-矩阵
寻找星空的孩子
CSDN博客首页:http://blog.csdn.net/u010579068?viewmode=list
博客园地址:http://www.cnblogs.com/yuyixingkong/
展开
-
矩阵快速幂取模
参考博客1:据说,矩阵快速幂在递推式优化上相当神奇,而且效率很高。。。 两矩阵相乘,朴素算法的复杂度是O(N^3)。如果求一次矩阵的M次幂,按朴素的写法就是O(N^3*M)。既然是求幂,不免想到快速幂取模的算法,这里有快速幂取模的介绍,a^b %m 的复杂度可以降到O(logb)。如果矩阵相乘是不是也可以实现O(N^3 * logM)的时间复杂度呢?答案是肯定的。转载 2015-02-08 15:52:43 · 1131 阅读 · 0 评论 -
面积最大的全1子矩阵(腾讯2012年暑期实习生招聘面试二面试题)
题目1497:面积最大的全1子矩阵时间限制:1 秒内存限制:128 兆特殊判题:否提交:1019解决:215题目描述:在一个M * N的矩阵中,所有的元素只有0和1,从这个矩阵中找出一个面积最大的全1子矩阵,所谓最大是指元素1的个数最多。输入:输入可能包含多个测试样例。对于每个测试案例,原创 2015-09-10 21:50:25 · 1988 阅读 · 0 评论 -
GukiZ and Binary Operations(矩阵+二进制)
Codeforces Round #307 (Div. 2) ,D. GukiZ and Binary Operations,原创 2015-06-16 20:22:03 · 1256 阅读 · 0 评论 -
希尔加密算法(湖南师范大学第六届大学生计算机程序设计竞赛)hnuoj11552
解密Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KBTotal submit users: 2, Accepted users: 0Problem 11552 : No special judgementProblem descrip原创 2015-06-08 22:44:45 · 1946 阅读 · 0 评论 -
Destroy Tunnels(矩阵水题)
Destroy TunnelsDescriptionZuosige always has bad luck. Recently, he is in hospital because of pneu原创 2015-05-12 21:14:42 · 836 阅读 · 0 评论 -
简单的传球游戏(矩阵)
简单的传球游戏 K(3Input第一行是一个整数T(T接下来T行,每行输入两个数N,K(3Output输出T行,每行输出一组N,K对应方案数模10^9+7后的结果。Sample Input23 33 4Sample Output26Hint原创 2015-05-09 23:47:32 · 1898 阅读 · 0 评论 -
Bell(hdu4767+矩阵+中国剩余定理)
BellTime Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 4767 DescriptionWhat? MMM is learning Combinatorics!? Looks like she原创 2015-05-08 23:52:32 · 1073 阅读 · 0 评论 -
Power of Matrix(uva11149+矩阵快速幂)
Power of MatrixTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice UVA 11149Appoint description: System Crawler (2015-03-15)Description原创 2015-03-23 11:33:01 · 688 阅读 · 0 评论 -
Training little cats(poj3735,矩阵快速幂)
Training little catsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 10737 Accepted: 2563DescriptionFacer's pet cat just gave birth to a brood of little原创 2015-03-23 11:32:56 · 621 阅读 · 0 评论 -
233 Matrix(hdu5015 矩阵)
233 MatrixTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1190 Accepted Submission(s): 700Problem DescriptionIn our daily life we ofte原创 2015-03-23 11:32:51 · 758 阅读 · 0 评论 -
Contemplation! Algebra(矩阵快速幂,uva10655)
Problem EContemplation! AlgebraInput: Standard InputOutput: Standard OutputTime Limit: 1 Second Given the value of a+b and ab you will have to find the value of an+bn InputThe input file原创 2015-03-23 11:32:47 · 578 阅读 · 0 评论 -
Fibonacci(矩阵)
FibonacciTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u DescriptionIn the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2.原创 2015-03-23 11:32:34 · 593 阅读 · 0 评论 -
Another kind of Fibonacci(矩阵)
Another kind of FibonacciTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1919 Accepted Submission(s): 738Problem DescriptionAs we all k原创 2015-03-23 11:32:41 · 745 阅读 · 0 评论 -
M斐波那契数列(矩阵快速幂+费马小定理)
M斐波那契数列Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1672 Accepted Submission(s): 482Problem DescriptionM斐波那契数列F[n]是一种整数数列,它的定义如下:F[0原创 2015-03-23 11:32:36 · 1260 阅读 · 0 评论 -
常系数线性递推的第n项及前n项和 (Fibonacci数列,矩阵)
(一)Fibonacci数列f[n]=f[n-1]+f[n-2],f[1]=f[2]=1的第n项的快速求法(不考虑高精度).解法:考虑1×2的矩阵【f[n-2],f[n-1]】。根据fibonacci数列的递推关系,我们希望通过乘以一个2×2的矩阵,得到矩阵【f[n-1],f[n]】=【f[n-1],f[n-1]+f[n-2]】很容易构造出这个2×2矩阵A,即:01原创 2015-03-23 11:32:29 · 659 阅读 · 1 评论 -
Evolution(矩阵快速幂)
EvolutionTime Limit: 5 Seconds Memory Limit: 32768 KB DescriptionEvolution is a long, long process with extreme complexity and involves many species. Dr. C. P. Lottery is currently invest原创 2015-03-23 11:32:25 · 544 阅读 · 0 评论 -
BestCoder Round #29——A--GTY's math problem(快速幂(对数法))、B--GTY's birthday gift(矩阵快速幂)
GTY's math problemTime Limit: 1000/1000 MS(Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem DescriptionGTY is a G原创 2015-03-23 11:32:18 · 785 阅读 · 0 评论 -
面积最大的全1子矩阵
面积最大的全1子矩阵时间限制:1 秒内存限制:128 兆特殊判题:否提交:859解决:179题目描述:在一个M * N的矩阵中,所有的元素只有0和1,从这个矩阵中找出一个面积最大的全1子矩阵,所谓最大是指元素1的个数最多。 输入:输入可能包含多个测试样例。对于每个测试案例,输入的第一行是两个整数m、n(1矩阵共有m行,每行有n个整数,分别是0或1,相原创 2015-03-23 11:31:44 · 619 阅读 · 0 评论 -
赛码网联考(20151030卷)
日期倒计时TimeLimit: 2000/1000 MS (Java/Others) MemoryLimit: 65536/65536 K (Java/Others)ProblemDescription:在经济、科技日益发达的今天,人们对时间的把握越来越严格,对于一个一定影响力的公司的高管来说,他可能要将自己的行程提前安排到下个月。对于普通人来说,他也可能将几天之后的安排已经提前做好。原创 2015-10-30 22:04:56 · 2535 阅读 · 2 评论