![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
HDU
文章平均质量分 89
Jonariguez
这个作者很懒,什么都没留下…
展开
-
HDU2570 贪心
迷瘴Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 2570Description通过悬崖的yifenfei,又面临着幽谷的考验―― 幽谷周围瘴气弥漫,静的可怕,隐约可见地上堆满了骷髅。由于此处原创 2014-09-02 20:15:05 · 1167 阅读 · 0 评论 -
HDU1710 二叉树的前、中、后遍历
Binary Tree TraversalsTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4438 Accepted Submission(s): 2025Problem DescriptionA binary tree原创 2015-08-01 09:28:35 · 1662 阅读 · 0 评论 -
HDU1166 敌兵布阵 树状数组|线段树-构造完全二叉树(理解)
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 57787 Accepted Submission(s): 24420Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子原创 2015-08-03 11:25:43 · 529 阅读 · 0 评论 -
HDU1018 Big Number n!的位数
Big NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 31053 Accepted Submission(s): 14398Problem DescriptionIn many applications ve原创 2015-08-14 22:42:13 · 509 阅读 · 0 评论 -
HDU1754 I Hate It 线段树(单点更新,区间最值)
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 49659 Accepted Submission(s): 19502Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从原创 2015-08-03 11:34:52 · 411 阅读 · 0 评论 -
HDU5573 Binary Tree
Binary TreeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 37 Accepted Submission(s): 20Special JudgeProblem DescriptionThe Old F原创 2015-11-29 11:15:26 · 2086 阅读 · 4 评论 -
HDU5584 LCM Walk 数学公式
LCM WalkTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 47 Accepted Submission(s): 31Problem DescriptionA frog has just learned s原创 2015-11-29 11:27:25 · 1699 阅读 · 0 评论 -
HDU5583 Kingdom of Black and White
Kingdom of Black and WhiteTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 65 Accepted Submission(s): 33Problem DescriptionIn the原创 2015-11-29 11:37:14 · 932 阅读 · 0 评论 -
HDU5652India and China Origins 并查集
India and China OriginsTime Limit: 2000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 118 Accepted Submission(s): 34Problem DescriptionA long ti原创 2016-03-26 22:06:58 · 856 阅读 · 0 评论 -
HDU5651 xiaoxin juju needs help 组合
xiaoxin juju needs helpTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 293 Accepted Submission(s): 87Problem DescriptionAs we all原创 2016-03-26 22:20:54 · 494 阅读 · 0 评论 -
HDU5653 Bomber Man wants to bomb an Array. DP
Bomber Man wants to bomb an Array.Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 246 Accepted Submission(s): 82Problem Description原创 2016-03-27 14:16:21 · 562 阅读 · 0 评论 -
HDU1021 Fibonacci Again (同余)
这是一道变换了的斐波那契数列,但是你如果写成递归函数的话内存是不够的,因为n的范围很大,如果你把前20项打出来的话,你会发现规律:就是从2开始是yes,每隔4个就是yes,其余是no。按这个规律编程绝对没问题,但是我还是愿意在这里证明一下其正确性。我们看前七项,并设为ai:7 11 18 29 47 76 123a1 a2 a3 a4 a5 a6 a7易知a3和a7是能被3整除的,其实如果只知道a3能被3整除,就能推出a7也能被3整除:a7 =原创 2014-09-13 09:26:14 · 777 阅读 · 0 评论 -
HDU 1452 Happy 2004 (因子和)
Happy 2004Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1102 Accepted Submission(s): 791Problem DescriptionConsider a positive intege原创 2015-04-24 20:51:43 · 732 阅读 · 0 评论 -
HDU 1228 A + B (水题)
A + BTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13260 Accepted Submission(s): 7797Problem Description读入两个小于100的正整数A和B,计算A+B.需要注意原创 2015-04-10 19:56:56 · 389 阅读 · 0 评论 -
HDU1009 贪心思想
这个题的大意是:它有M猫食,N个房间,每个房间有f[i]猫食,j[i]量的 javabean,按一定的比例拿猫食来保护javabean。问一共有M猫食最多能保护多少javabean。简单的贪心,只需按每个房间的javabean和猫食的比例从高到底排序,然后贪心即可。代码中我处理了输入时f[i]等于0的情况,但交上去WA,我删去之后就AC了,看来没必要处理啊,原创 2014-09-02 21:40:43 · 585 阅读 · 0 评论 -
HDU1019 最小公倍数
Least Common MultipleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30295 Accepted Submission(s): 11460Problem DescriptionThe least原创 2014-08-21 17:03:10 · 1174 阅读 · 0 评论 -
HDU 2570 迷障 贪心
迷瘴Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4093 Accepted Submission(s): 1402Problem Description通过悬崖的yifenfei,又面临着幽谷的考验——幽谷周围原创 2014-10-17 12:06:47 · 814 阅读 · 0 评论 -
HDU1728 逃离迷宫 DFS
这个题卡在不知道怎么判是否转弯,不过看了大神的解题就懂了,程序里的(dir!=-1 && i!=dir)就是用来判断是否转弯了。本题我是用的dfs,找到终点时并不晕就返回真,程序并没有遍历整个图。并且在走重时会根据在重点的转弯是turn判断以选优,这在程序中操作,并作为剪枝,注意本题剪枝很重要,不然会超时的。下面俩解释一下bfs()中if()剪枝中为什么相等的情况不能剪掉(先看代码去)原创 2014-08-24 12:06:11 · 5005 阅读 · 2 评论 -
HDU1052 Tian Ji -- The Horse Racing 贪心
Tian Ji -- The Horse RacingTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1052DescriptionHere is a famous story in Chinese原创 2014-09-03 12:41:59 · 864 阅读 · 0 评论 -
HDU1028,解析母函数
这是一道基本的母函数问题,具体什么是母函数和它的作用有多么强大,这在百度百科上说的很明白,我就不多说了,只说说母函数在程序里怎么用。母函数问题都可以用模板解题的,可重点可能有很多人不理解模板的原理,特别是那三个for循环更是让人晕头转向,我也在网上看了好多讲解,也有我自己的理解,我们就那这个整数拆分的题来说:首先由这道题我们能写出函数:(#式) (1+x+x^2+x^3+x^4+x^5+....)*(1+x^2+x^4+x^6+x^8+x^10+....)*(1+x^3+x^6+x^9+x^12...原创 2014-08-05 10:47:29 · 662 阅读 · 0 评论 -
HDU1051 Wooden Sticks 贪心
简单的贪心,只需要不停的扫描这n个木棍,符合条件就继续往后扫,已经比过的直接跳过,到最后没了时间就+1,然后再从头扫描,用一个cnt来计数,循环结束的条件是cnt==n。 注意一定要先排序!!原创 2014-09-15 19:41:40 · 684 阅读 · 0 评论 -
HDU2601,An easy problem
该题确实在个简单的问题,因为可能形式很简单,但它又不是那么的简单。如果这个题选择有两个for循环来写的话,那毫无疑问将超时,所以需要仔细分析一下,可以看出,N=i*j+i+j可以变形为:N+1=( i+1)*( j+1),且由 0<i<=j,可知:1<( i+1)<=( j+1),所以就以(i+1)为基准来进行循环,所以只需要单层循环即可。再有,由于要考虑它的重复性,所以循环只需要进行到sqrt(N+1)即可,往后再循环的必重复。本题 i 要从1开始,所以 i+1 就要从2开始循环,一直到sqrt(N+原创 2014-08-03 14:17:48 · 1243 阅读 · 0 评论 -
HDU1896 优先队列2
D - 优先队列入门2Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1896DescriptionBecause of the wrong status of the bicycle, Sempr原创 2014-08-01 15:54:31 · 812 阅读 · 0 评论 -
HDU1873 优先队列
STL实现优先队列使用方法:头文件:#include <queue>声明方式:priority_queue<int>q;结构体的声明方式:struct node{ int x, y; friend bool operator < (node a, node b) { return a.x > b.x; //结构体中,x小的优先级高 }};原创 2014-08-01 10:48:27 · 580 阅读 · 0 评论 -
HDU 5654 xiaoxin and his watermelon candy 归并树
xiaoxin and his watermelon candyTime Limit: 4000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 161 Accepted Submission(s): 38Problem Description原创 2016-03-27 14:23:59 · 566 阅读 · 0 评论