![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
【HDU】
xia842655187
这个作者很懒,什么都没留下…
展开
-
hdu 1016 Prime Ring Problem(dfs,素数环)
Prime Ring ProblemTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionA ring is compose of n circles as shown in diagram. Put natural numbe原创 2016-07-28 15:05:24 · 401 阅读 · 0 评论 -
HDU 1072 Nightmare(bfs 广度优先搜索)
NightmareTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionIgnatius had a nightmare last night. He found himself in a labyrinth with a time bomb原创 2016-04-21 15:15:28 · 348 阅读 · 0 评论 -
连连看(bfs ,优先队列搜索)
连连看Time Limit:10000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription“连连看”相信很多人都玩过。没玩过也没关系,下面我给大家介绍一下游戏规则:在一个棋盘中,放了很多的棋子。如果某两个相同的棋子,可以通过一条线连起来(这条线不能经过其它棋子),而且线的原创 2016-04-20 20:57:40 · 1764 阅读 · 0 评论 -
HDU 1869 六度分离(floyd 变形 ,有向图传递闭包 变形)
六度分离Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription1967年,美国著名的社会学家斯坦利・米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多原创 2016-04-20 20:29:35 · 398 阅读 · 0 评论 -
HDU 1978 How many ways (dfs 记忆化搜索)
How many waysTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下: 1.机器人一开始在棋盘的起始点并有起始点所标有的能量。 2.机原创 2016-04-20 20:08:36 · 473 阅读 · 0 评论 -
HDU 1698 Just a Hook(区间修改,求累加和)
F - Just a HookTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thi原创 2016-05-14 18:49:15 · 339 阅读 · 0 评论 -
HDU 1166 敌兵布阵(树状数组 or 线段树 单点修改 区间求和)
敌兵布阵Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这原创 2016-05-14 19:20:42 · 683 阅读 · 0 评论 -
HDU 1060 Leftmost Digit(求 n ^ n 的最高位的值)
Leftmost DigitTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionGiven a positive integer N, you should output the leftmost digit of N^N原创 2016-05-14 19:01:49 · 312 阅读 · 0 评论 -
hdu 1262 寻找素数对(素数的判断,快速筛选素数)
寻找素数对Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription哥德巴赫猜想大家都知道一点吧.我们现在不是想证明这个结论,而是想在程序语言内部能够表示的数集中,任意取出一个偶数,来寻找两个素数,使得其和等于该偶数. 做好了这件实事,原创 2016-05-14 18:56:34 · 589 阅读 · 0 评论 -
最小生成树 Kruskal 算法 和 Prim算法
Kruskal 算法 和 Prim算法 是 最小生成树基础的两种算法:本文章中的代码用c语言写的(不过头文件用了c++ 的,大家不要在意), 其实在 Kruskal 算法 里面对数据进行排序的时候 可以用 C++ 库函数 的 sort排序进行排序 ,不过这里面我写了一个 快排,用快排进行排序了! 在 Kruskal 算法 里面,用到了并查集的 查询 和 合并 两个函数,主要是用来检原创 2016-04-13 21:07:55 · 421 阅读 · 0 评论 -
HDU 2181 哈密顿绕行世界问题(DFS 深度优先搜素)
哈密顿绕行世界问题Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input前原创 2016-04-20 21:18:10 · 367 阅读 · 0 评论 -
OJ提交题目中的语言选项里G++与C++的区别
根本差别:hduoj上,g++用的是mingw,c++用的是msvc;mingw 的 I/O 速度比较慢,这也是一些人用G++超时,而C++ AC的原因差别一:1、输出double类型时,如果采用G++提交,scanf采用%lf,prinf采用%f,否则会报错2、使用GCC/G++的提醒:对于64位整数, long long int 和 __int64 都是支持并原创 2016-05-06 09:55:09 · 1297 阅读 · 0 评论 -
HDU 1010 Tempter of the Bone(DFS + 剪枝)
Tempter of the BoneTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot.原创 2016-07-28 14:50:44 · 258 阅读 · 0 评论 -
HDU 1254 推箱子 (搜索中套搜索,BFS + DFS 这感觉,酸爽!)
推箱子 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription推箱子是一个很经典的游戏.今天我们来玩一个简单版本.在一个M*N的房间里有一个箱子和一个搬运工,搬运工的工作就是把箱子推到指定的位置,注意,搬运工只能推箱原创 2016-07-28 11:32:13 · 1107 阅读 · 0 评论 -
HDU 1086 You can Solve a Geometry Problem too (判断线段交叉,线段跨立)
You can Solve a Geometry Problem too Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionMany geometry(几何)problems were designed in the AC原创 2016-05-21 10:14:20 · 415 阅读 · 0 评论 -
线段交叉判断(快速排斥实验 + 跨立实验)
第1 步:快速排斥试验,如果分别以P1P2 ,P3P4 为对角线做矩形,而这两个矩形不相交,则这两条线段肯定不相交,如下左图;即使两个矩形相交,这两条线段也不一定相交,如下右图,这时再用第2 步判断; 表示成语句,即两个矩形相交当且仅当下列式子为真:(max(x1,x2)≥mi原创 2016-05-21 10:17:40 · 10967 阅读 · 1 评论 -
HDU 4709 Herding(叉积求三角形面积)
HerdingTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionLittle John is herding his father's cattles. As a lazy boy, he cannot tolerate c原创 2016-05-21 10:02:55 · 770 阅读 · 0 评论 -
HDU 1520 & POJ 2342 Anniversary party(树形dp)
Anniversary partyTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uDescriptionThere is going to be a party to celebrate the 80-th Anniversary of t原创 2016-05-06 21:34:34 · 529 阅读 · 0 评论 -
HDU 1003 Max Sum(经典DP,)
Max Sum 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原创 2016-05-06 19:45:51 · 539 阅读 · 0 评论 -
HDU 1619 & UVA 116 Unidirectional TSP(树形dp,入门 , 数塔变形)
Unidirectional TSPDescriptionBackgroundProblems that require minimum paths through some domain appear in many different areas of computer science. For example, one of the const原创 2016-05-06 18:06:44 · 761 阅读 · 0 评论 -
UVA 11368 & POJ 3636 & HDU 1677 Nested Dolls(贪心 + 二分LIS)
A - Nested DollsTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionDilworth is the world’s most prominent collector of Russian nested dolls: h原创 2016-05-06 17:15:57 · 1188 阅读 · 0 评论 -
HDU 1256 画8
画8Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5352 Accepted Submission(s): 2296Problem Description谁画8画的好,画的快,今后就发的快,学业发原创 2016-04-01 11:17:10 · 299 阅读 · 0 评论 -
HDU 2545 树上战争(并查集)
树上战争给一棵树,如果树上的某个节点被某个人占据,则它的所有儿子都被占据,lxh和pfz初始时分别站在两个节点上,谁当前所在的点被另一个人占据,他就输了比赛,问谁能获胜原创 2015-09-26 11:27:53 · 422 阅读 · 0 评论 -
A+B for Input-Output Practice (VIII)
A+B for Input-Output Practice (VIII)Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 119913 Accepted Submission(s): 36850Problem D原创 2015-10-17 18:51:28 · 870 阅读 · 0 评论 -
三角形
三角形Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 61045 Accepted Submission(s): 20612Problem Description给定三条边,请你判断一下能不能组成一个三原创 2015-10-17 18:38:57 · 880 阅读 · 0 评论 -
水仙花数
水仙花数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 131341 Accepted Submission(s): 38573Problem Description春天是鲜花的季节,水仙花就是其中最迷原创 2015-10-17 18:48:29 · 507 阅读 · 0 评论 -
HDU 1002 A + B Problem II (大数加法)
A + B Problem II Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.原创 2015-09-28 11:09:56 · 495 阅读 · 0 评论 -
HDU 1022 Train Problem I (STL - 栈的使用)
Train Problem I Problem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over the world ^v^).原创 2015-09-28 10:43:51 · 648 阅读 · 0 评论 -
hdu 3466 Proud Merchants (排序的dp)
/*HDU 3466需要排序的01背包*/hdu 3466 Proud MerchantsProblem DescriptionRecently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are still very prou原创 2015-08-04 15:41:16 · 1014 阅读 · 2 评论 -
HDU 1242 Rescue(广搜,优先队列)
HDU 1242 RescueProblem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison.Angel's friends want to save Angel. Their ta原创 2015-08-13 10:36:21 · 448 阅读 · 0 评论 -
杭电ACM(HDUOJ)试题分类
杭电ACM试题分类 第一篇 1001 这个就不用说了吧 1002 简单的大数 1003 DP经典问题,最大连续子段和 1004 简单题 1005 找规律(循环点)1006 感觉有点BT的题,我到现在还原创 2015-08-11 08:36:49 · 2033 阅读 · 1 评论 -
HDU 1180 诡异的楼梯(广搜、优先队列)
HDU 1180 诡异的楼梯Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 10885 Accepted Submission(s): 2704Problem DescriptionHogwarts正原创 2015-08-08 20:36:30 · 1137 阅读 · 0 评论 -
母牛的故事
母牛的故事Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 55713 Accepted Submission(s): 27817Problem Description有一头母牛,它每年年初生一头小母牛。原创 2015-10-17 18:46:55 · 282 阅读 · 0 评论 -
蟠桃记
入ACM集训队? 蟠桃记Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 44852 Accepted Submission(s): 33710Problem Description原创 2015-10-17 18:43:08 · 523 阅读 · 0 评论 -
HDU 1213 How Many Tables( 并查集)
How Many TablesProblem DescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, and all the friends原创 2015-09-28 11:18:26 · 579 阅读 · 0 评论 -
HDU 1865 1sting(大数斐波那契数列,模拟加法)
1stingTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4306 Accepted Submission(s): 1634Problem DescriptionYou will be given a原创 2015-11-14 19:34:46 · 770 阅读 · 3 评论 -
HDU 2955 Robberies (01背包dp)
RobberiesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 16848 Accepted Submission(s): 6217Problem Descri原创 2015-09-24 20:41:08 · 315 阅读 · 0 评论 -
HDU 1176(NYOJ 613) 免费馅饼(dp)
免费馅饼 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)原创 2015-10-09 19:11:23 · 325 阅读 · 0 评论 -
HDU 1176 免费馅饼(DP)
免费馅饼 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)原创 2015-11-07 22:14:35 · 480 阅读 · 0 评论 -
HDU 1495 非常可乐 (BFS)
非常可乐 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)原创 2015-10-21 19:30:15 · 1627 阅读 · 0 评论