01 2023 档案
hdu:点对统计(强连通分量kosaraju)
摘要:Problem Description给定一个有向图,每个点ii有点权a_ia​i​​,请对于每个点ii,找到ii能到达的点中点权的最大值(包括ii点)。 Input第一行包含一个正整数T(1\leq T\leq 10)T(1≤T≤10),表示测试数据的组数。 每组数据第一行包含两个正整数n,m(1 阅读全文
posted @ 2023-01-31 16:34 ruoye123456 阅读(100) 评论(0) 推荐(0) 编辑
hdu: You Are the One(区间DP)
摘要:Problem Description The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, TJUT hold the 阅读全文
posted @ 2023-01-30 13:53 ruoye123456 阅读(22) 评论(0) 推荐(0) 编辑
hdu: Dire Wolf(区间DP)
摘要:Problem DescriptionDire wolves, also known as Dark wolves, are extraordinarily large and powerful wolves. Many, if not all, Dire Wolves appear to orig 阅读全文
posted @ 2023-01-30 12:44 ruoye123456 阅读(28) 评论(0) 推荐(0) 编辑
hdu:Two Rabbits(区间DP)
摘要:Problem DescriptionLong long ago, there lived two rabbits Tom and Jerry in the forest. On a sunny afternoon, they planned to play a game with some sto 阅读全文
posted @ 2023-01-30 10:33 ruoye123456 阅读(35) 评论(0) 推荐(0) 编辑
hdu: 改革春风吹满地(叉乘求面积)
摘要:Problem Description“ 改革春风吹满地,不会AC没关系;实在不行回老家,还有一亩三分地。谢谢!(乐队奏乐)” 话说部分学生心态极好,每天就知道游戏,这次考试如此简单的题目,也是云里雾里,而且,还竟然来这么几句打油诗。好呀,老师的责任就是帮你解决问题,既然想种田,那就分你一块。这块田 阅读全文
posted @ 2023-01-28 11:01 ruoye123456 阅读(16) 评论(0) 推荐(0) 编辑
保留小数,有效位数
摘要:#include<iostream> #include<cstring> #include<iomanip> using namespace std; int main() { double ce=1.2323; cout<<setprecision(4)<<ce<<endl;//1.232 cou 阅读全文
posted @ 2023-01-28 10:53 ruoye123456 阅读(16) 评论(0) 推荐(0) 编辑
hdu:Shape of HDU(判断多边形凹凸)
摘要:Problem Description话说上回讲到海东集团推选老总的事情,最终的结果是XHD以微弱优势当选,从此以后,“徐队”的称呼逐渐被“徐总”所取代,海东集团(HDU)也算是名副其实了。创业是需要地盘的,HDU向钱江肉丝高新技术开发区申请一块用地,很快得到了批复,据说这是因为他们公司研发的“海东 阅读全文
posted @ 2023-01-28 10:44 ruoye123456 阅读(64) 评论(0) 推荐(0) 编辑
hdu:"红色病毒"问题(指数型母函数用e^x指数函数来计算)
摘要:Problem Description医学界发现的新病毒因其蔓延速度和Internet上传播的”红色病毒”不相上下,被称为”红色病毒”,经研究发现,该病毒及其变种的DNA的一条单链中,胞嘧啶,腺嘧啶均是成对出现的。现在有一长度为N的字符串,满足一下条件:(1) 字符串仅由A,B,C,D四个字母组成; 阅读全文
posted @ 2023-01-27 18:05 ruoye123456 阅读(52) 评论(0) 推荐(0) 编辑
康托展开和康托逆展开
摘要:#include<bits/stdc++.h> using namespace std; int f[20]; int main() { ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); f[0]=1; for(int i=1;i<=10;++ 阅读全文
posted @ 2023-01-27 11:32 ruoye123456 阅读(15) 评论(0) 推荐(0) 编辑
hdu:排列组合(指数型母函数)
摘要:Problem Description有n种物品,并且知道每种物品的数量。要求从中选出m件物品的排列数。例如有两种物品A,B,并且数量都是1,从中选2件物品,则排列有”AB”,”BA”两种。 Input每组输入数据有两行,第一行是二个数n,m(1<=m,n<=10),表示物品数,第二行有n个数,分别 阅读全文
posted @ 2023-01-27 10:35 ruoye123456 阅读(116) 评论(0) 推荐(0) 编辑
hdu:Fruit(母函数)
摘要:Problem Description转眼到了收获的季节,由于有TT的专业指导,Lele获得了大丰收。特别是水果,Lele一共种了N种水果,有苹果,梨子,香蕉,西瓜……不但味道好吃,样子更是好看。 于是,很多人们慕名而来,找Lele买水果。 甚至连大名鼎鼎的HDU ACM总教头 lcy 也来了。lc 阅读全文
posted @ 2023-01-27 09:52 ruoye123456 阅读(48) 评论(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 阅读(38) 评论(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 阅读(24) 评论(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 阅读(18) 评论(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 阅读(22) 评论(0) 推荐(0) 编辑
hdu:剪花布条(kmp)
摘要:Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字 阅读全文
posted @ 2023-01-23 11:21 ruoye123456 阅读(32) 评论(0) 推荐(0) 编辑
输入问题
摘要:#include<bits/stdc++.h> using namespace std; int main() { int m,n; scanf("%d: (%d)",&m,&n);//输入1: (3) cout<<m<<' '<<n;//输出1 3 return 0; } #include<bit 阅读全文
posted @ 2023-01-23 11:06 ruoye123456 阅读(20) 评论(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 阅读(14) 评论(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 阅读(19) 评论(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 阅读(19) 评论(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 阅读(25) 评论(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 阅读(152) 评论(0) 推荐(0) 编辑
hdu: Count(矩阵快速幂)
摘要:Problem DescriptionFarmer John有n头奶牛.某天奶牛想要数一数有多少头奶牛,以一种特殊的方式:第一头奶牛为1号,第二头奶牛为2号,第三头奶牛之后,假如当前奶牛是第n头,那么他的编号就是2倍的第n-2头奶牛的编号加上第n-1头奶牛的编号再加上自己当前的n的三次方为自己的编号 阅读全文
posted @ 2023-01-14 20:50 ruoye123456 阅读(34) 评论(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 阅读(54) 评论(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 阅读(26) 评论(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 阅读(60) 评论(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 阅读(149) 评论(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 阅读(13) 评论(0) 推荐(0) 编辑
hdu:I Hate It(线段树单点更新)
摘要:Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input本题目包含多组测试,请处 阅读全文
posted @ 2023-01-11 23:31 ruoye123456 阅读(11) 评论(0) 推荐(0) 编辑
常用库函数
摘要:1.reverse和unique #include<algorithm> #include<iostream> #include<vector> using namespace std; int main() { vector<int> v({1,2,3,4,5,5}); reverse(v.beg 阅读全文
posted @ 2023-01-09 12:36 ruoye123456 阅读(31) 评论(0) 推荐(0) 编辑
简单位运算
摘要:#include<iostream> int main() { int a=1; int b=8; std::cout<<(~a)<<'\n'; std::cout<<(a<<1)<<'\n'; std::cout<<(a<<1|1)<<'\n'; std::cout<<(b>>3&1)<<'\n' 阅读全文
posted @ 2023-01-08 21:56 ruoye123456 阅读(21) 评论(0) 推荐(0) 编辑
hdu:张煊的金箍棒(2)(线段树)
摘要:Problem Description张煊的金箍棒升级了! 升级后的金箍棒是由几根相同长度的金属棒连接而成(最开始都是铜棒,从1到N编号); 张煊作为金箍棒的主人,可以对金箍棒施以任意的变换,每次变换操作就是将一段连续的金属棒(从X到Y编号)改为铜棒,银棒或金棒。 金箍棒的总价值计算为N个金属棒的价 阅读全文
posted @ 2023-01-08 20:46 ruoye123456 阅读(78) 评论(0) 推荐(0) 编辑
hdu:张煊的金箍棒(3)(线段树)
摘要:Problem Description张煊的金箍棒升级了! 升级后的金箍棒是由N段相同长度的金属棒连接而成(最开始每段金属棒的价值都是1,从1到N编号); 张煊作为金箍棒的主人,可以对金箍棒任意一段施展魔法操作,每次操作就是将一段连续的金属棒(从X到Y编号)每一段都增加价值Z(Z为1,2,3三种)。 阅读全文
posted @ 2023-01-08 20:37 ruoye123456 阅读(54) 评论(0) 推荐(0) 编辑
hdu:Choose the best route(dijstra,虚设点)
摘要:Problem DescriptionOne day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soo 阅读全文
posted @ 2023-01-06 19:01 ruoye123456 阅读(20) 评论(0) 推荐(0) 编辑
hdu:最短路(堆优化的dijkstra)
摘要:Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input输入包括多组数据。每组数据第一行是两个整数 阅读全文
posted @ 2023-01-06 14:48 ruoye123456 阅读(34) 评论(0) 推荐(0) 编辑
hdu:甘老板发红包-2(拓扑排序,邻接表,链式前向星)
摘要:Problem Description甘晨煜是一家软件公司的创始人,人称“甘老板”。 经过几年的努力,公司已经准备在纳斯达克上市,甘老板自然也是心情大好。随着中秋节的临近,甘老板决定为员工们每人发个红包。 现在的问题是,每人发多少红包呢?要知道,很多员工提出了自己的要求,比如,胡承轩就提出他的红包应 阅读全文
posted @ 2023-01-06 10:04 ruoye123456 阅读(132) 评论(0) 推荐(0) 编辑
hdu: 张煊的金箍棒(3)(树状数组的区间修改,区间查询)
摘要:Problem Description张煊的金箍棒升级了! 升级后的金箍棒是由N段相同长度的金属棒连接而成(最开始每段金属棒的价值都是1,从1到N编号); 张煊作为金箍棒的主人,可以对金箍棒任意一段施展魔法操作,每次操作就是将一段连续的金属棒(从X到Y编号)每一段都增加价值Z(Z为1,2,3三种)。 阅读全文
posted @ 2023-01-05 18:19 ruoye123456 阅读(176) 评论(0) 推荐(0) 编辑
hdu:sort it(逆序对,离散化)
摘要:Problem Description给定n(n<=100000)个正整数,希望对其从小到大排序,如果采用冒泡排序算法,请计算需要进行的交换次数。 Input输入包含多组测试用例,每组用例由两行组成:第一行包含一个正整数n(n <=100000);第二行包含n个不同的正整数Ai(Ai<=109)。 阅读全文
posted @ 2023-01-03 19:14 ruoye123456 阅读(53) 评论(0) 推荐(0) 编辑