随笔分类 -  杭电进阶题

hdu:Fruit(母函数)
摘要:Problem Description转眼到了收获的季节,由于有TT的专业指导,Lele获得了大丰收。特别是水果,Lele一共种了N种水果,有苹果,梨子,香蕉,西瓜……不但味道好吃,样子更是好看。 于是,很多人们慕名而来,找Lele买水果。 甚至连大名鼎鼎的HDU ACM总教头 lcy 也来了。lc 阅读全文
posted @ 2023-01-27 09:52 ruoye123456 阅读(63) 评论(0) 推荐(0)
hdu:The Balance(母函数)
摘要: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 y 阅读全文
posted @ 2023-01-26 19:21 ruoye123456 阅读(47) 评论(0) 推荐(0)
hdu:Kiki & Little Kiki 2(矩阵快速幂)
摘要:Problem 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< k<= n) is the ligh 阅读全文
posted @ 2023-01-25 10:23 ruoye123456 阅读(44) 评论(0) 推荐(0)
hdu:Simpsons’ Hidden Talents(kmp)
摘要:Problem DescriptionHomer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it?Homer: Take 阅读全文
posted @ 2023-01-24 13:33 ruoye123456 阅读(33) 评论(0) 推荐(0)
hdu:Big Event in HDU(母函数,背包)
摘要:Problem DescriptionNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don’t know that Computer College had e 阅读全文
posted @ 2023-01-24 13:01 ruoye123456 阅读(32) 评论(0) 推荐(0)
hdu:剪花布条(kmp)
摘要:Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字 阅读全文
posted @ 2023-01-23 11:21 ruoye123456 阅读(45) 评论(0) 推荐(0)
hdu:Holding Bin-Laden Captive(母函数,数学)
摘要:Problem DescriptionWe all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reported that he h 阅读全文
posted @ 2023-01-19 11:44 ruoye123456 阅读(22) 评论(0) 推荐(0)
hdu:Square Coins(母函数)
摘要:Problem DescriptionPeople in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values 阅读全文
posted @ 2023-01-19 10:37 ruoye123456 阅读(29) 评论(0) 推荐(0)
hdu:Ignatius and the Princess III(母函数)
摘要:Problem Description“Well, it seems the first problem is too easy. I will let you know how foolish you are later.” feng5166 says. “The second problem i 阅读全文
posted @ 2023-01-15 18:15 ruoye123456 阅读(30) 评论(0) 推荐(0)
hdu:Another kind of Fibonacci(含多种关系的矩阵快速幂)
摘要:Problem 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 kind of Fibo 阅读全文
posted @ 2023-01-15 16:28 ruoye123456 阅读(37) 评论(0) 推荐(0)
hdu:Sum of Tribonacci Numbers(带前缀和矩阵快速幂)
摘要:Problem DescriptionEverybody knows Fibonacci numbers, now we are talking about the Tribonacci numbers:T[0] = T[1] = T[2] = 1;T[n] = T[n - 1] + T[n - 2 阅读全文
posted @ 2023-01-15 09:49 ruoye123456 阅读(177) 评论(0) 推荐(0)
hdu: Count(矩阵快速幂)
摘要:Problem DescriptionFarmer John有n头奶牛.某天奶牛想要数一数有多少头奶牛,以一种特殊的方式:第一头奶牛为1号,第二头奶牛为2号,第三头奶牛之后,假如当前奶牛是第n头,那么他的编号就是2倍的第n-2头奶牛的编号加上第n-1头奶牛的编号再加上自己当前的n的三次方为自己的编号 阅读全文
posted @ 2023-01-14 20:50 ruoye123456 阅读(53) 评论(0) 推荐(0)
hdu:Queuing(矩阵快速幂)
摘要:Problem DescriptionQueues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily lif 阅读全文
posted @ 2023-01-14 16:52 ruoye123456 阅读(62) 评论(0) 推荐(0)
hdu:Problem Description Lele now is thinking about a s(矩阵快速幂)
摘要:Problem DescriptionLele now is thinking about a simple function f(x). If x < 10 f(x) = x.If x >= 10 f(x) = a0 f(x-1) + a1 f(x-2) + a2 f(x-3) + …… + a9 阅读全文
posted @ 2023-01-14 11:11 ruoye123456 阅读(42) 评论(0) 推荐(0)
hdu: Tr A(矩阵快速幂)
摘要:Problem DescriptionA为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。 Input数据的第一行是一个T,表示有T组数据。每组数据的第一行有n(2 <= n <= 10)和k(2 <= k < 10^9)两个数据。接下来有n行,每行有n个数 阅读全文
posted @ 2023-01-13 19:09 ruoye123456 阅读(80) 评论(0) 推荐(0)
hdu:解方程(hash)
摘要:Problem Description给定一方程如下:ax1^2 + bx2^2 + cx3^2 + dx4^2=0 其中:a, b, c, d在整数区间[-50,50]内取值,并且都不等于0. 求方程在区间[-100,100] 内的非零整数解的个数。 Input输入包含多组测试数据。每组数据占一行 阅读全文
posted @ 2023-01-13 12:24 ruoye123456 阅读(170) 评论(0) 推荐(0)
hdu:Ignatius and the Princess II(全排列,dfs)
摘要:Problem DescriptionNow our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty Princess. B 阅读全文
posted @ 2023-01-12 10:03 ruoye123456 阅读(47) 评论(0) 推荐(0)
hdu:I Hate It(线段树单点更新)
摘要:Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input本题目包含多组测试,请处 阅读全文
posted @ 2023-01-11 23:31 ruoye123456 阅读(20) 评论(0) 推荐(0)
hdu:张煊的金箍棒(2)(线段树)
摘要:Problem Description张煊的金箍棒升级了! 升级后的金箍棒是由几根相同长度的金属棒连接而成(最开始都是铜棒,从1到N编号); 张煊作为金箍棒的主人,可以对金箍棒施以任意的变换,每次变换操作就是将一段连续的金属棒(从X到Y编号)改为铜棒,银棒或金棒。 金箍棒的总价值计算为N个金属棒的价 阅读全文
posted @ 2023-01-08 20:46 ruoye123456 阅读(98) 评论(0) 推荐(0)
hdu:张煊的金箍棒(3)(线段树)
摘要:Problem Description张煊的金箍棒升级了! 升级后的金箍棒是由N段相同长度的金属棒连接而成(最开始每段金属棒的价值都是1,从1到N编号); 张煊作为金箍棒的主人,可以对金箍棒任意一段施展魔法操作,每次操作就是将一段连续的金属棒(从X到Y编号)每一段都增加价值Z(Z为1,2,3三种)。 阅读全文
posted @ 2023-01-08 20:37 ruoye123456 阅读(71) 评论(0) 推荐(0)