
算法
文章平均质量分 77
寒山小妖
你被别人嫉妒说明你卓越,你嫉妒别人说明你无能。
展开
-
连连看
连连看Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25619 Accepted Submission(s): 6356Problem Description“连连看”相信很多人都玩过。没玩过也没关系原创 2017-03-26 12:41:16 · 471 阅读 · 0 评论 -
单词数
单词数Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Practice HDU 2072Descriptionlily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个原创 2016-07-17 14:48:17 · 570 阅读 · 0 评论 -
圆桌会议
圆桌会议Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem Description HDU ACM集训队的队员在暑假集训时经常要讨论自己在做题中遇到的问题.每当面临自己解决不了的问题时,他们就会围坐在一张圆形的桌子旁进行交流,经过大原创 2016-07-17 14:38:16 · 469 阅读 · 0 评论 -
Filthy Rich(数塔)
Filthy RichProblem DescriptionThey say that in Phrygia, the streets are paved with gold. You’re currently on vacation in Phrygia, and to your astonishment you discover that this is to be taken原创 2016-07-17 14:31:21 · 556 阅读 · 0 评论 -
画8
画8Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription谁画8画的好,画的快,今后就发的快,学业发达,事业发达,祝大家发,发,发. Input输入的第一行为一个整数N,表示后面有N组数据. 每组数据中有一个字符和一个整数,字符表示画笔,原创 2016-07-17 14:27:23 · 427 阅读 · 0 评论 -
Y2K Accounting Bug
Y2K Accounting BugDescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual report for MS Inc. All what they remember i原创 2016-07-17 14:08:36 · 1359 阅读 · 0 评论 -
区间相交问题
区间相交问题Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Practice FZU 1230Description给定 x 轴上 n 个闭区间。去掉尽可能少的闭区间,使剩下的闭区间都不相交。★算法设计: 对于给定的 n 个闭区间,计算去掉的最少闭区间数。原创 2016-07-17 13:56:20 · 436 阅读 · 0 评论 -
今年暑假不AC
今年暑假不ACTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription“今年暑假不AC?” “是的。” “那你干什么呢?” “看世界杯呀,笨蛋!” “@#$%^&*%...” 确实如此,世界杯来了,球迷的节日也来了,估计很原创 2016-07-17 13:55:00 · 379 阅读 · 0 评论 -
Wooden Sticks
Wooden SticksTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in adva原创 2016-07-17 13:32:40 · 359 阅读 · 0 评论 -
FatMouse' Trade
FatMouse' TradeTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the原创 2016-07-17 13:14:48 · 344 阅读 · 0 评论 -
Doing Homework again
Doing Homework againTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of ho原创 2016-07-15 23:02:08 · 415 阅读 · 0 评论 -
大数A+B问题
A + B Problem IITime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionI have a very simple problem for you. Given two integers A and B, your job is to calcul原创 2016-07-13 23:01:09 · 489 阅读 · 0 评论 -
Hangman Judge
Hangman Judge Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Practice UVA 489DescriptionDownload as PDFIn ``Hangman Judge,'' you are to write a program that jud原创 2016-07-15 22:48:27 · 393 阅读 · 0 评论 -
Text Reverse
Text ReverseTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Practice HDU 1062DescriptionIgnatius likes to write words in reverse way. Given a single line o原创 2016-07-15 22:55:23 · 395 阅读 · 0 评论 -
不要62
不要62Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Practice HDU 2089Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数原创 2016-08-02 09:22:05 · 393 阅读 · 0 评论 -
The Triangle(数塔)
The TriangleTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %lluDescription7 3 8 8 1 0 2 7 4 44 5 2 6 5(Figure 1)Figure 1 s原创 2016-08-02 15:21:01 · 355 阅读 · 0 评论 -
李白打酒
李白打酒 话说大诗人李白,一生好饮。幸好他从不开车。 一天,他提着酒壶,从家里出来,酒壶中有酒2斗。他边走边唱: 无事街上走,提壶去打酒。 逢店加一倍,遇花喝一斗。 这一路上,他一共遇到店5次,遇到花10次,已知最后一次遇到的是花,他正好把酒喝光了。 请你计算李白遇到店和花的次序,可以把遇店记为a,遇花记为b。则:babaabb原创 2017-01-14 17:18:14 · 366 阅读 · 0 评论 -
部分和问题
部分和问题题目:给定整数a1,a2,...,an,判断是否可以从中选出若干个数,使他们的和恰好为k。限定条件:1输入:41 2 4 71341 2 4 715输出:YesNo//解法一:这段代码是我根据01背包的思想做的,我把问题看成是容量为k的背包,有n件体积和价值都为a[i]的物品,求出背包能装的最大价值,如果最大价值正好等于背包容量,也就是原创 2016-09-05 13:52:48 · 494 阅读 · 0 评论 -
汉诺塔(三)
汉诺塔(三)时间限制: 3000ms内存限制: 128000KB 64位整型: Java 类名:题目描述在印度,有这么一个古老的传说:在世界中心贝拿勒斯(在印度北部)的圣庙里,一块黄铜板上插着三根宝石针。印度教的主神梵天在创造世界的时候,在其中一根针上从下到上地穿好了由大到小的64片金片,这就是所谓的汉诺塔。不论白天黑夜,总有一个僧侣在按照下面的法则移动这些金片:一次只移原创 2016-08-17 23:46:07 · 515 阅读 · 0 评论 -
最小生成树-Prim算法和Kruskal算法
最小生成树-Prim算法和Kruskal算法 原文来自博客园http://www.cnblogs.com/biyeymyhjob/archive/2012/07/30/2615542.htmlPrim算法1.概览普里姆算法(Prim算法),图论中的一种算法,可在加权连通图里搜索最小生成树。意即由此算法搜索到的边子集所构成的树中,不但包括了连通图里的所有顶点(英语:Verte转载 2016-08-15 19:42:30 · 394 阅读 · 0 评论 -
Radar Installation(区间选点)
Radar InstallationTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 51131 Accepted: 11481DescriptionAssume the coasting is an infinite straight line原创 2016-08-07 23:59:55 · 427 阅读 · 6 评论 -
Integer Intervals(区间选点)
Integer IntervalsTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %lluDescriptionAn integer interval [a,b], a Write a program that: finds the minimal number of eleme原创 2016-08-07 23:51:39 · 670 阅读 · 5 评论 -
大明A+B
大明A+BTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription话说,经过了漫长的一个多月,小明已经成长了许多,所以他改了一个名字叫“大明”。 这时他已经不是那个只会做100以内加法的那个“小明”了,现在他甚至会任意长度的正小数的加法。 现在,给你原创 2016-08-07 23:43:01 · 774 阅读 · 3 评论 -
空心三角形
空心三角形Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription把一个字符三角形掏空,就能节省材料成本,减轻重量,但关键是为了追求另一种视觉效果。在设计的过程中,需要给出各种花纹的材料和大小尺寸的三角形样板,通过电脑临时做出来,以便看看效果。Input原创 2016-08-07 23:36:59 · 601 阅读 · 6 评论 -
Common Subsequence(LCS最长公共子序列)
Common SubsequenceTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%lld & %lluDescriptionA subsequence of a given sequence is the given sequence with some elements (possible原创 2016-08-07 23:20:54 · 425 阅读 · 2 评论 -
免费馅饼(数塔)
免费馅饼Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12017 Accepted Submission(s): 3997Description 都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉原创 2016-08-07 22:26:49 · 457 阅读 · 3 评论 -
Charm Bracelet(01背包)
Charm BraceletTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluDescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd原创 2016-08-07 19:29:05 · 417 阅读 · 5 评论 -
What Are You Talking About
What Are You Talking AboutTime Limit:5000MS Memory Limit:204800KB 64bit IO Format:%I64d & %I64u Practice HDU 1075DescriptionIgnatius is so lucky that he met a Martian yesterday原创 2016-08-03 08:26:36 · 1111 阅读 · 0 评论 -
Oil Deposits(DFS)
Oil DepositsTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Practice HDU 1241DescriptionGeoSurvComp地质调查公司负责探测地下石油储藏。 GeoSurvComp现在在一块矩形区域探测石油,并把这个大区域分成了很多小原创 2016-08-02 21:55:46 · 403 阅读 · 0 评论 -
城堡问题(DFS)
城堡问题(搜索) 总时间限制: 1000ms 内存限制: 65536kB描述 (图 1)# = Wall | = No wall - = No wall图1是一个城堡的地形图。请你编写一个程序,计算城堡一共有多少房间,最大的房间有多大。城堡被分割成m*n(m≤50,n≤50)个方块,每个方块可以有0~4面墙。输入 程序从标准输入设备读入数原创 2016-08-02 16:19:38 · 1753 阅读 · 0 评论 -
1sting
1stingTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionYou will be given a string which only contains ‘1’; You can merge two adjacent ‘1’ to be ‘2’, o原创 2016-08-07 23:47:37 · 352 阅读 · 2 评论