随笔分类 - ACM---矩阵
摘要:Matrix multiplicationTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1775Accepted Submission(s):...
阅读全文
摘要:Hard WuxingAccepted : 13Submit : 166Time Limit : 1000 MSMemory Limit : 65536 KB题目描述“五行”是中国传统哲学思想,它认为认为大自然的现象由“木、火、土、金、水”这五种气的变化所总括, 不但影响到人的命运,同时也使宇宙万物...
阅读全文
摘要:Easy WuxingAccepted : 25Submit : 124Time Limit : 1000 MSMemory Limit : 65536 KB题目描述“五行”是中国传统哲学思想,它认为认为大自然的现象由“木、火、土、金、水”这五种气的变化所总括, 不但影响到人的命运,同时也使宇宙万物循环不已。 五行具有相生相克的性质,规律如下:五行相克:金克木,木克土,土克水,水克火,火克金。 五行相生:金生水,水生木,木生火,火生土,土生金。 五行任一行与其他五行的关系为:同我、生我、我生、克我、我克。 给你一个1*n的格子,将五行填上去,每格填一个,要求相邻格以及首尾格不能是同我和相克的关
阅读全文
摘要:1313: ZZY的宠物Time Limit: 2 SecMemory Limit: 128 MBSubmit: 114Solved: 59[Submit][Status][Web Board]DescriptionZZY领养了一对刚刚出生的不知名小宠物..巨萌巨可爱!!...小宠物的生命为5个单位时间并且不会在中间出意外翘辫子(如: 从0出生能活到5但活不到6)..小宠物经过2个单位时间成熟..刚刚成熟的一对小宠物能立即生育6只新的小宠物(如: 从0出生的一对在2时成熟并进行第一次生育)...小宠物是很忠诚的..不会在中途换伴侣..每对小宠物生育一次这一对的生育能力就会降低2个..也就是说一
阅读全文
摘要:Problem 1692 Key problemAccept: 103 Submit: 553 Time Limit: 1000 mSec Memory Limit : 32768 KBProblem DescriptionWhenever rxw meets Coral, he requires her to give him the laboratory key. Coral does not want to give him the key, so Coral ask him one question. if rxw can solve the problem, she will giv
阅读全文
摘要:奥运Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1936Accepted Submission(s): 491Problem Description北京迎来了第一个奥运会,我们的欢呼声响彻中国大地,所以今年的奥运金牌 day day up!比尔盖兹坐上鸟巢里,手里摇着小纸扇,看的不亦乐乎,被俺们健儿的顽强拼搏的精神深深的感动了。反正我的钱也多的没地方放了,他对自己说,我自己也来举办一个奥运会,看谁的更火。不过他的奥运会很特别:1 参加人员必
阅读全文
摘要:How many ways??Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1031Accepted Submission(s): 341Problem Description春天到了, HDU校园里开满了花, 姹紫嫣红, 非常美丽. 葱头是个爱花的人, 看着校花校草竞相开放, 漫步校园, 心情也变得舒畅. 为了多看看这迷人的校园, 葱头决定, 每次上课都走不同的路线去教室, 但是由于时间问题, 每次只能经过k个地方, 比方说, 这次葱头决定
阅读全文
摘要:Problem 1683 纪念SlingShotAccept: 361Submit: 1287Time Limit: 1000 mSecMemory Limit : 32768 KB Problem Description已知 F(n)=3 * F(n-1)+2 * F(n-2)+7 * F(n-3),n>=3,其中F(0)=1,F(1)=3,F(2)=5,对于给定的每个n,输出F(0)+ F(1)+ …… + F(n) mod 2009。 Input第一行是一整数m,代表总共有m个cases。 Output对于每个case,输出一行。格式见样例,冒号后有一个空格。 Sample Inp
阅读全文
摘要:Kiki & Little Kiki 2Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1659Accepted Submission(s): 837Problem DescriptionThere are n lights in a circle numbered from 1 to n. The left of light 1 is light n, and the left of light k (1= 0), if the le
阅读全文
摘要:Another kind of FibonacciTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1219Accepted Submission(s): 466Problem DescriptionAs we all known , the Fibonacci series : F(0) = 1, F(1) = 1, F(N) = F(N - 1) + F(N - 2) (N >= 2).Now we define another kin
阅读全文
摘要:Tr ATime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1994 Accepted Submission(s): 1472 Problem DescriptionA为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。Input数据的第一行是一个T,表示有T组数据。 每组数据的第一行有n(2 2 #include 3 #include 4 #include 5 using namespace std;.
阅读全文
摘要:矩阵是一个很好的工具,参考别人到博客:http://mindlee.net/2011/11/21/matrix-multiply/经典矩阵相乘10题,大牛博客 http://www.matrix67.com/blog/archives/276/ 1 /* 2 矩阵的运用很宽泛 3 */ 4 #include 5 #include 6 #include 7 #include 8 #define N 100 9 #define mod 10000007 10 using namespace std; 11 12 struct Matrix 13 { 14 int mat...
阅读全文
摘要:A Simple Math ProblemTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1838Accepted Submission(s): 1053Problem DescriptionLele now is thinking about a simple function f(x).If x = 10 f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x-10);A
阅读全文
摘要:FibonacciTime Limit:1000MSMemory Limit:65536KTotal Submissions:7715Accepted:5474DescriptionIn the Fibonacci integer sequence,F0= 0,F1= 1, andFn=Fn− 1+Fn− 2forn≥ 2. For example, the first ten terms of the Fibonacci sequence are:0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …An alternative formula for the Fibonacc
阅读全文
浙公网安备 33010602011771号