![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
HDU
文章平均质量分 93
童话ing
放弃不难,但坚持一定很酷。
展开
-
hdu5562(贪心)
Clarke is a patient with multiple personality disorder. One day, Clarke turned into a cook, was shopping for food. Clarke has bought nn food. The volume of the iith food is vivi. Now Clarke ha原创 2017-02-25 18:27:31 · 301 阅读 · 0 评论 -
hdu6205
Problem DescriptionAs a fan of Doudizhu, WYJ likes collecting playing cards very much. One day, MJF takes a stack of cards and talks to him: let's play a game and if you win, you can get all the原创 2017-09-11 20:45:30 · 362 阅读 · 0 评论 -
hdu5950(递推+矩阵快速幂函) 2016亚洲区域赛沈阳站C题(铜牌题)
版权声明:本文为博主原创文章,未经博主允许不得转载。Recursive sequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 98 Accepted Submission(s): 46原创 2017-10-15 20:25:46 · 311 阅读 · 0 评论 -
hdu6025(思维僵化)
Total Submission(s): 1327 Accepted Submission(s): 637Problem DescriptionDo you know what is called ``Coprime Sequence''? That is a sequence consists of n positive integers, and the GC原创 2017-10-18 19:35:30 · 348 阅读 · 0 评论 -
hdu1575(矩阵快速幂基础)
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1575Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5724 Accepted Submission(s): 430原创 2017-10-18 20:19:43 · 414 阅读 · 0 评论 -
hdu5115(区间dp)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5115题意:有n只狼站在一排,每只狼都有自己的基础伤害的额外伤害。如果你杀死一只狼,那么你将承受这只狼的基础伤害加上相邻两只狼的额外伤害。现在让你求出将这些狼全部杀死所承受的最小伤害。思路:看见n不大那么直接想到区间dp(好吧,其实最先想到的是贪心),dp[i][j]表示杀死[i,j]区间狼承受原创 2017-10-21 20:04:35 · 317 阅读 · 0 评论 -
hdu5112(思维)
Matt’s friend K.Bro is an ACMer.Yesterday, K.Bro learnt an algorithm: Bubble sort. Bubble sort will compare each pair of adjacent items and swap them if they are in the wrong order. The process re原创 2017-10-21 19:52:38 · 287 阅读 · 0 评论 -
hdu5120(相交环面积)
IntersectionTime Limit: 4000/4000 MS (Java/Others)Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 41Accepted Submission(s): 22Problem DescriptionMatt is a big fan...原创 2017-10-21 19:43:21 · 395 阅读 · 0 评论 -
hdu5512
A Curious MattTime Limit: 2000/2000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem Description There is a c原创 2017-10-21 20:42:12 · 336 阅读 · 0 评论 -
hdu5543(01背包变换)
Problem DescriptionThe story happened long long ago. One day, Cao Cao made a special order called "Chicken Rib" to his army. No one got his point and all became very panic. However, Cao Cao himsel原创 2017-11-09 21:28:35 · 298 阅读 · 0 评论 -
hdu5952(暴搜+剪枝+铜牌题)
Counting CliquesTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2956 Accepted Submission(s): 1072Problem DescriptionA clique原创 2017-10-16 16:06:01 · 435 阅读 · 0 评论 -
hdu6237(思维能力)
欢迎杭电广大新生参加2017新生赛(点击红色的Registerring)A Simple Stone GameTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 419 Accepted Submi原创 2017-11-12 19:23:22 · 1438 阅读 · 0 评论 -
hdu5547(深搜)
Problem DescriptionYi Sima was one of the best counselors of Cao Cao. He likes to play a funny game himself. It looks like the modern Sudoku, but smaller.Actually, Yi Sima was playing it different....原创 2017-11-13 21:20:21 · 380 阅读 · 0 评论 -
hdu6222(递推规律+java大数)
A triangle is a Heron’s triangle if it satisfies that the side lengths of it are consecutive integers t−1, t, t+ 1 and thatits area is an integer. Now, for given n you need to find a Heron’s...原创 2017-11-05 10:11:57 · 2652 阅读 · 0 评论 -
HDU1016(简单dfs)
Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime....原创 2018-06-29 12:56:53 · 367 阅读 · 0 评论 -
HDU1233(基础最小生成树 prim和 kruskal)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1233prim算法:算法从任意一个顶点开始,每次选择一个与当前顶点集最近的一个顶点,并将两顶点之间的边加入到树中。Prim算法在找当前最近顶点时使用到了贪婪算法。代码实现:#include<bits/stdc++.h>using namespace std;const in...原创 2018-08-04 19:31:51 · 1799 阅读 · 0 评论 -
hdu6197(最长上升子序列)
One day, Kaitou Kiddo had stolen a priceless diamond ring. But detective Conan blocked Kiddo's path to escape from the museum. But Kiddo didn't want to give it back. So, Kiddo asked Conan a question.原创 2017-09-11 20:24:04 · 283 阅读 · 0 评论 -
hdu6195(数学)
Problem DescriptionConnecting the display screen and signal sources which produce different color signals by cables, then the display screen can show the color of the signal source.Notice that eve原创 2017-09-11 20:14:39 · 301 阅读 · 0 评论 -
hdu1242(bfs)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1242题意:天使被困在监狱,他的朋友们想见他,监狱的地形复杂,包括路(用点标示),墙(用#标示),天使的位置(用a标示),他的朋友(用r标示),监狱里还有守卫(用x标示),他的朋友只能向左右上下四个方向走,走以不花一单位时间,若碰上守卫,消灭守卫需要额外花费一单位时间。问最少多长时间天使能见到他的朋...原创 2017-03-09 14:48:22 · 338 阅读 · 2 评论 -
hdu1242(bfs+优先队列)
#includeusing namespace std;const int maxn=250;char a[maxn][maxn];int vis[maxn][maxn];int dir[4][2]= {1,0,-1,0,0,1,0,-1};int n,m,countt=0;struct node{ int x; int y; int原创 2017-03-09 15:37:03 · 366 阅读 · 0 评论 -
dp46上 HDU2084
在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? 已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 0,990,99内。 Output对于每个测试实例,输出原创 2017-04-13 17:18:32 · 357 阅读 · 0 评论 -
dp46上 HDU1421
搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度是和左右手的物品的重量差的平方成正比(这里补充原创 2017-04-13 19:51:48 · 257 阅读 · 0 评论 -
HDU4725(spfa+双端队列优化)
Problem DescriptionThis is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algoritmo. If you do not understand a word of ...原创 2017-04-19 12:38:49 · 912 阅读 · 0 评论 -
HDU4283 区间dp
You Are the OneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3829 Accepted Submission(s): 1769Problem Description The TV s原创 2017-04-16 15:30:00 · 288 阅读 · 0 评论 -
hdu 6134(莫比乌斯反演)
Battlestation OperationalTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 464Accepted Submission(s): 254Problem Description&g...原创 2017-08-20 15:34:35 · 4959 阅读 · 0 评论 -
hdu 6143(精妙的递推)
Problem Description> Galen Marek, codenamed Starkiller, was a male Human apprentice of the Sith Lord Darth Vader. A powerful Force-user who lived during the era of the Galactic Empire, Marek origi原创 2017-08-20 16:21:44 · 539 阅读 · 0 评论 -
HDU 6119(区间交叉问题)
题目链接:HDU6119度度熊喜欢着喵哈哈村的大明星——星星小姐。为什么度度熊会喜欢星星小姐呢?首先星星小姐笑起来非常动人,其次星星小姐唱歌也非常好听。但这都不是最重要的,最重要的是,星星小姐拍的一手好代码!于是度度熊关注了星星小姐的贴吧。一开始度度熊决定每天都在星星小姐的贴吧里面签到。但是度度熊是一个非常健忘的孩子,总有那么几天,度度熊忘记签到,于是就断掉了他的连续签到。不过度...原创 2017-08-14 20:22:00 · 352 阅读 · 0 评论 -
hdu 6168(stl)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6168代码:#includeusing namespace std;int main(){ int n; while(scanf("%d",&n)!=EOF) { multisetint>s; for(int i=1;in;i++原创 2017-08-22 19:31:58 · 221 阅读 · 0 评论 -
hdu 6130(水水数据 or 暴力)
This is Kolakosiki sequence: 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1……. This sequence consists of 1 and 2, and its first term equals 1. Besides, if you see adjacent and equal terms as one group,原创 2017-08-15 21:25:31 · 362 阅读 · 0 评论 -
hdu 6170(正则表达式)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6170代码来源:http://blog.csdn.net/algzjh/article/details/77484741由不会正则表达,当然这道题也可以dp做,好奇就去看了一下正则。链接:http://www.runoob.com/java/java-regular-expressions.ht原创 2017-08-23 10:33:33 · 296 阅读 · 0 评论 -
hdu 6165(dfs or bfs or tarjan+topsort)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6165题意:一张有向图,n个点,m条边,保证没有重边和自环。询问任意两个点能否满足任何一方能够到达另外一方。思路:枚举每个点,预处理搜出与这个点相连接的所有点,看看能不能搜出一条链出来,当然要注意一种情况,u-v,v-u这种也是可行的,特殊处理一下。代码:#includeusing原创 2017-08-22 19:29:20 · 1153 阅读 · 0 评论 -
hdu1232(基础并查集)
Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 10...原创 2017-09-23 10:46:34 · 425 阅读 · 0 评论 -
hdu1856&&poj1308(基础并查集)
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26363 Accepted Submission(s): 6028Problem DescriptionA tree is a well-known dat原创 2017-09-23 10:07:29 · 254 阅读 · 0 评论 -
HDU1880(HASH+unordered_map)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1880题目信息:Problem Description哈利波特在魔法学校的必修课之一就是学习魔咒。据说魔法世界有100000种不同的魔咒,哈利很难全部记住,但是为了对抗强敌,他必须在危急时刻能够调用任何一个需要的魔咒,所以他需要你的帮助。给你一部魔咒词典。当哈利听到一个魔咒时,你的程序必须...原创 2019-09-05 20:45:00 · 354 阅读 · 0 评论