随笔分类 - 矩阵乘法 && 母函数
摘要:Arc of DreamTime Limit: 2000/2000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 419Accepted Submission(s): 148Problem DescriptionAn Arc of Dream is a curve defined by following function:wherea0= A0ai= ai-1*AX+AYb0= B0bi= bi-1*BX+BYWhat is the value of AoD(N) modulo 1,
阅读全文
摘要:PartitionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 797Accepted Submission(s): 322Problem DescriptionDefine f(n) as the number of ways to perform n in format of the sum of some positive integers. For instance, when n=4, we have4=1+1+1+14=1+1+2
阅读全文
摘要:Matrix Power SeriesTime Limit:3000MSMemory Limit:131072KTotal Submissions:11954Accepted:5105DescriptionGiven an×nmatrixAand a positive integerk, find the sumS=A+A2+A3+ … +Ak.InputThe input contains exactly one test case. The first line of input contains three positive integersn(n≤ 30),k(k≤ 109)
阅读全文
摘要:QueuingTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1949Accepted Submission(s): 911Problem DescriptionQueues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There ar
阅读全文
摘要:Problem of PrecisionTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 686Accepted Submission(s): 386Problem DescriptionInputThe first line of input gives the number of cases, T. T test cases follow, each on a separate line. Each test case contains on
阅读全文
摘要:选课时间(题目已修改,注意读题)Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2026Accepted Submission(s): 1612 Problem Description又到了选课的时间了,xhd看着选课表发呆,为了想让下一学期好过点,他想知道学n个学分共有多少组合。你来帮帮他吧。(xhd认为一样学分的课没区别)Input输入数据的第一行是一个数据T,表示有T组数据。 每组数据的第一行是两个整数n(1 using namespa
阅读全文
摘要:FruitTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2280Accepted Submission(s): 1266 Problem Description转眼到了收获的季节,由于有TT的专业指导,Lele获得了大丰收。特别是水果,Lele一共种了N种水果,有苹果,梨子,香蕉,西瓜……不但味道好吃,样子更是好看。于是,很多人们慕名而来,找Lele买水果。甚至连大名鼎鼎的HDU ACM总教头 lcy 也来了。lcy抛出一打百元大钞,&qu
阅读全文
摘要:Coin ChangeTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9842Accepted Submission(s): 3300 Problem DescriptionSuppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given
阅读全文
摘要:The BalanceTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4293Accepted Submission(s): 1725 Problem DescriptionNow you are asked to measure a dose of medicine with a balance and a number of weights. Certainly it is not always achievable. So you sh
阅读全文
摘要:Big Event in HDUTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 16262Accepted Submission(s): 5741 Problem DescriptionNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College
阅读全文
摘要:Square CoinsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6093Accepted Submission(s): 4111 Problem DescriptionPeople in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of
阅读全文
摘要:Holding Bin-Laden Captive!Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 11029Accepted Submission(s): 4943 Problem DescriptionWe all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reporte
阅读全文
摘要:Ignatius and the Princess IIITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9017Accepted Submission(s): 6341 Problem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says
阅读全文
摘要:找单词Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2739Accepted Submission(s): 1941 Problem Description假设有x1个字母A, x2个字母B,..... x26个字母Z,同时假设字母A的价值为1,字母B的价值为2,..... 字母Z的价值为26。那么,对于给定的字母,可以找到多少价值#include#includeusing namespace std;const int N=50;int
阅读全文
摘要:1492: 费马定理http://www.acmore.net/problem.php?id=1492Time Limit:1 SecMemory Limit:128 MBSubmit:82Solved:14SubmitStatusWeb BoardDescription以数学家命名的定理有很多,其中费马定理就是其中之一,费马定理表明如果一个素数p不能整除整数a那么a^(p-1)%p=1恒成立。试验可知p-1并不一定是该式成立的最小指数,那么你能找出最小的指数x满足a^x%p=1吗?Input若干组测试数据,每组数据占一行共两个整数a(1#include#include#includeusin
阅读全文
摘要:Rightmost Digithttp://acm.hdu.edu.cn/showproblem.php?pid=1061Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 21580 Accepted Submission(s): 8242 Problem DescriptionGiven a positive integer N, you should output the most right digit of N^N.InputThe
阅读全文