---------------HDU---------------
文章平均质量分 72
Marx_W
这个作者很懒,什么都没留下…
展开
-
HDU——1177 Accepted Today?(简单排序)
Problem DescriptionDo you remember a sentence “Accepted today?” Yes, the sentence is mentioned frequently in lcy’s course “ACM Programming”! The contest is still in progress this moment. How excite...原创 2018-04-29 19:40:33 · 497 阅读 · 0 评论 -
HDU——1085 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 hides in Hang Zhou of China! “Oh, God! How terr...原创 2018-03-23 18:28:46 · 136 阅读 · 0 评论 -
HDU——1171 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 ever been split into Computer College and Softwar...原创 2018-03-25 20:37:52 · 231 阅读 · 0 评论 -
HDU——1398 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 of all square numbers up to 289 (=17^2), i.e., ...原创 2018-03-25 20:40:50 · 195 阅读 · 0 评论 -
HDU——1028 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 is, given an positive integer N, we define an eq...原创 2018-03-25 20:44:54 · 155 阅读 · 0 评论 -
HDU——1203 I need a offer(dp)
Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了他得...原创 2018-03-29 19:23:20 · 128 阅读 · 0 评论 -
HDU——1241 Oil deposits(dfs)
Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a...原创 2018-03-31 16:26:14 · 179 阅读 · 0 评论 -
HDU——1584 蜘蛛牌(剪枝 + dfs)
Problem Description蜘蛛牌是windows xp操作系统自带的一款纸牌游戏,游戏规则是这样的:只能将牌拖到比她大一的牌上面(A最小,K最大),如果拖动的牌上有按顺序排好的牌时,那么这些牌也跟着一起移动,游戏的目的是将所有的牌按同一花色从小到大排好,为了简单起见,我们的游戏只有同一花色的10张牌,从A到10,且随机的在一行上展开,编号从1到10,把第i号上的牌移到第j号牌上,移...原创 2018-04-03 20:32:54 · 195 阅读 · 0 评论 -
HDU——2553 N皇后问题(dfs打表)
Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。Output共有若干行,每行一个正整数,表示对应输入...原创 2018-04-03 20:37:05 · 172 阅读 · 0 评论 -
HDU——1003 Max Sum(dp 最大子段和 !!)
Problem DescriptionGiven a sequence a[1],a[2],a[3]……a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 =...原创 2018-04-03 20:40:06 · 161 阅读 · 0 评论 -
HDU——1087 Super Jumping!Jumping!Jumping!(dp 递增子序列最大和)
Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to yo...原创 2018-04-08 16:55:57 · 376 阅读 · 0 评论 -
HDU——1077 Catching fish(几何问题)
Problem DescriptionIgnatius likes catching fish very much. He has a fishnet whose shape is a circle of radius one. Now he is about to use his fishnet to catch fish. All the fish are in the lake, and...原创 2018-04-15 20:58:51 · 382 阅读 · 1 评论 -
HDU——1029 Ignatius and the Princess IV(水题 降低时间复杂度)
Problem Description“OK, you are not too bad, em… But you can never pass the next test.” feng5166 says.“I will tell you an odd number N, and then N integers. There will be a special integer among t...原创 2018-04-14 15:50:39 · 241 阅读 · 0 评论 -
HDU——1142 A walking through the forest(Dijkstra + DFS)
Problem DescriptionJimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to walk home. To make things even n...原创 2018-03-22 20:19:37 · 233 阅读 · 0 评论 -
HDU——1176 免费馅饼(动态规划 类似数塔问题)
Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个...原创 2018-03-20 19:09:54 · 322 阅读 · 0 评论 -
HDU——1114 Piggy-Bank(完全背包)
Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The ...原创 2018-03-18 15:53:52 · 234 阅读 · 0 评论 -
HDU——1050 Moving Tables(贪心算法)
Problem DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200 rooms each on the north side and so...原创 2018-04-29 19:28:23 · 247 阅读 · 0 评论 -
HDU——1160 FatMouse's Speed(DP 最长递增/减子序列)
Problem DescriptionFatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as pos...原创 2018-05-07 16:52:28 · 340 阅读 · 0 评论 -
HDU——1284 钱币兑换问题(母函数+打表)
Problem Description在一个国家仅有1分,2分,3分硬币,将钱N兑换成硬币有很多种兑法。请你编程序计算出共有多少种兑法。Input每行只有一个正整数N,N小于32768。Output对应每个输入,输出兑换方法数。Sample Input2934 12553Sample Output718831 13137761解题思路...原创 2018-05-06 15:58:23 · 405 阅读 · 0 评论 -
HDU——1159 Common Subsequence(DP 最长公共子序列)
Problem Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, …, xm> another sequence Z = < z1,...原创 2018-05-06 16:05:41 · 248 阅读 · 0 评论 -
HDU——1232 畅通工程(并查集)
Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )...原创 2018-04-21 19:25:06 · 191 阅读 · 0 评论 -
HDU——1987 How Many Ways(记忆化搜索 + dp)
Problem Description这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下: 1.机器人一开始在棋盘的起始点并有起始点所标有的能量。 2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。 3.机器人不能在原地停留。 4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。 ...原创 2018-05-02 20:17:01 · 173 阅读 · 0 评论 -
HDU——1089~1095 A+B for Input-Output Practice
题目大意:计算 A+B 或者 一个数组的和, 适合练习不同的输入输出格式。1089代码:#include<cstdio>using namespace std;int main(){ int a , b; while(scanf("%d %d", &a , &b) != EOF){ printf("%d\n" ,...原创 2018-04-20 19:24:05 · 185 阅读 · 0 评论 -
HDU——1054 Strategic game(匈牙利算法(最大匹配))
Problem DescriptionBob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He ...原创 2018-03-08 17:05:17 · 221 阅读 · 0 评论 -
HDU——1059 Dividing(多重背包+二进制优化)
Problem DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the m...原创 2018-03-10 19:19:02 · 215 阅读 · 0 评论 -
HDU——1074 Doing homework (动态规划——状态压缩)
Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in ...原创 2018-03-13 19:51:32 · 324 阅读 · 0 评论 -
HDU——1078 Fatmouse and cheese(记忆搜索 + 动态规划)
Problem DescriptionFatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q &l...原创 2018-03-13 20:05:00 · 320 阅读 · 0 评论 -
HDU_1086 You can solve a geometry problem too(计算几何)
Problem DescriptionMany geometry(几何)problems were designed in the ACM/ICPC. And now, I also prepare a geometry problem for this final exam. According to the experience of many ACMers, geometry probl...原创 2018-03-14 19:53:15 · 226 阅读 · 0 评论 -
HDU——2566 统计硬币 (简单枚举 || 母函数)
Problem Description假设一堆由1分、2分、5分组成的n个硬币总面值为m分,求一共有多少种可能的组合方式(某种面值的硬币可以数量可以为0)。Input输入数据第一行有一个正整数T,表示有T组测试数据; 接下来的T行,每行有两个数n,m,n和m的含义同上。Output对于每组测试数据,请输出可能的组合方式数; 每组输出占一行。Sample In...原创 2018-04-15 21:07:13 · 794 阅读 · 0 评论 -
HDU——2079 选课时间(母函数)
Problem Description又到了选课的时间了,xhd看着选课表发呆,为了想让下一学期好过点,他想知道学n个学分共有多少组合。你来帮帮他吧。(xhd认为一样学分的课没区别)Input输入数据的第一行是一个数据T,表示有T组数据。 每组数据的第一行是两个整数n(1 <= n <= 40),k(1 <= k <= 8)。 接着有k行,每行有两个整数...原创 2018-04-18 22:46:59 · 373 阅读 · 0 评论 -
HDU——Doing Homework Again(贪心算法)
Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in ...原创 2018-04-22 19:25:42 · 816 阅读 · 2 评论 -
HDU——1014 Uniform Generator
Problem Description Computer simulations often require random numbers. One way to generate pseudo-random numbers is via a function of the formseed(x+1) = [seed(x) + STEP] % MODwhere ‘%’ is the mo...原创 2017-06-09 23:29:23 · 200 阅读 · 0 评论 -
HDU——1040 As Easy As A+B
Problem Description These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights. Give...原创 2017-06-10 21:06:09 · 257 阅读 · 0 评论 -
HDU——1039 Easier Done Than Said?
Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-ge...原创 2017-06-10 23:20:33 · 181 阅读 · 0 评论 -
HDU——1018Big Number
Big Number *Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 38918 Accepted Submission(s): 18910*Problem Description In many applications v原创 2017-09-23 16:28:00 · 159 阅读 · 0 评论 -
HDU——1020 Encoding
Encoding *Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 47730 Accepted Submission(s): 21182*Problem Description Given a string containin原创 2017-09-24 16:36:32 · 168 阅读 · 0 评论 -
HDU——1033 Edge
Problem DescriptionFor products that are wrapped in small packings it is necessary that the sheet of paper containing the directions for use is folded until its size becomes small enough. We assume ...原创 2018-03-05 16:13:50 · 161 阅读 · 0 评论 -
2015蓝桥杯——密文搜索
福尔摩斯从X星收到一份资料,全部是小写字母组成。 他的助手提供了另一份资料:许多长度为8的密码列表。 福尔摩斯发现,这些密码是被打乱后隐藏在先前那份资料中的。 请你编写一个程序,从第一份资料中搜索可能隐藏密码的位置。要考虑密码的所有排列可能性。 数据格式: 输入第一行:一个字符串s,全部由小写字母组成,长度小于1024*1024 紧接着一行是一个整数n,表示以下有n行密码,1<=n<=1原创 2017-05-08 22:18:30 · 385 阅读 · 0 评论 -
蓝桥1——快乐司机
问题描述 “嘟嘟嘟嘟嘟嘟 喇叭响 我是汽车小司机 我是小司机 我为祖国运输忙 运输忙” 这是儿歌“快乐的小司机”。话说现在当司机光有红心不行,还要多拉快跑。多拉不是超载,是要让所载货物价值最大,特别是在当前油价日新月异的时候。司机所拉货物为散货,如大米、面粉、沙石、泥土…… 现在知道了汽车核载重量为w,可供选择的物品的数量n。每个物品的重量为gi,价...原创 2018-03-01 16:58:42 · 213 阅读 · 0 评论 -
蓝桥2——Beaver's Calculator
问题描述 从万能词典来的聪明的海狸已经使我们惊讶了一次。他开发了一种新的计算器,他将此命名为”Beaver’s Calculator 1.0”。它非常特别,并且被计划使用在各种各样的科学问题中。 为了测试它,聪明的海狸邀请了n位科学家,编号从1到n。第i位科学家给这个计算器带来了 ki个计算题。第i个科学家带来的问题编号1到n,并且它们必须按照编号一个一个计算,因为对于每个问题的计算都...原创 2018-03-02 22:51:01 · 303 阅读 · 0 评论