算法设计
tianxuanlove
这个作者很懒,什么都没留下…
展开
-
HDU2093考试排名
考试排名Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3966 Accepted Submission(s): 1364Problem DescriptionC++编程考试使用的实时提交系统,具有即时获得成绩...原创 2011-08-12 09:58:30 · 86 阅读 · 0 评论 -
HDU2030汉字统计
汉字统计Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8828 Accepted Submission(s): 4994Problem Description统计给定文本文件中汉字的个数。 Inp...原创 2011-08-02 11:15:35 · 92 阅读 · 0 评论 -
HDU2034人见人爱A-B
[url]http://acm.hdu.edu.cn/showproblem.php?pid=2034[/url]人见人爱A-BTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18330 Accepted Submissi...原创 2011-08-02 11:06:16 · 195 阅读 · 0 评论 -
求n个元素集合的子集(幂集)或n个元素的组合
回溯法是设计递归过程的一种重要方法,它的求解过程是遍历一个状态树,只是这颗树不是预先建立的而是隐含的遍历过程,在遍历过程中对各个元素进行取舍。如求n个元素集合的子集,如A = {1, 2, 3}则A集合的子集有: PrA = {{1,2,3}, {1,2}, {1,3},{1},{2,3},{2},{3},{}}遍历过程中的状态树:[img]http://dl.iteye...原创 2011-10-21 13:19:17 · 724 阅读 · 0 评论 -
螺旋矩阵
给一个正整数n,输出一个n*n的螺旋矩阵螺旋矩阵可以是逆时针也可以是顺时针,也可以是从里到外,也可以是从外到里顺时针,从外到里:[img]http://dl.iteye.com/upload/attachment/572662/416ffcef-483b-3100-83ba-a52bbc9394f7.jpg[/img][code="java"]#include us...原创 2011-10-19 13:26:46 · 179 阅读 · 0 评论 -
HDU2896(病毒侵袭)
[align=center]病毒侵袭[/align]Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2557 Accepted Submission(s): 667Problem Description当太阳的...原创 2011-09-26 13:46:40 · 107 阅读 · 0 评论 -
HDU2025
查找最大元素Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11078 Accepted Submission(s): 5998Problem Description对于输入的每个字符串,查找其中的最大字母,在...原创 2011-07-09 10:38:11 · 124 阅读 · 0 评论 -
HDU1003
Max SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 52982 Accepted Submission(s): 11890Problem DescriptionGiven a sequence a[1...原创 2011-07-08 11:49:08 · 95 阅读 · 0 评论 -
HDU1232
畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10509 Accepted Submission(s): 5312Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表...原创 2011-07-08 08:35:02 · 62 阅读 · 0 评论 -
POJ1579
[url]http://poj.org/problem?id=1579[/url]Function Run FunTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 11121 Accepted: 5815 DescriptionWe all love recursion! Don't we? ...原创 2011-07-06 13:21:14 · 159 阅读 · 0 评论 -
HDU1856
[url]http://acm.hdu.edu.cn/showproblem.php?pid=1856[/url]More is betterTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 2834 Accepted ...原创 2011-07-04 01:49:06 · 85 阅读 · 0 评论 -
HDU1060
[url]http://acm.hdu.edu.cn/showproblem.php?pid=1060[/url]此题输入数据比较大,在vc中已不能用long存下,要用_int64,关于它的介绍 int64 是有符号 64 位整数数据类型,也就是 C# 中的 long 和 SQL Server 中的 bigint,范围为 -2^63 (-9,223,372,036,854,775,808)...原创 2011-07-03 10:14:44 · 111 阅读 · 0 评论 -
HDU1002
[url]http://acm.hdu.edu.cn/showproblem.php?pid=1002[/url][code="java"]#include #include #define MAX 2000char a[MAX], b[MAX];int c[MAX];int atoi(char c){ return c - '0';}//算法思...原创 2011-07-02 22:28:11 · 87 阅读 · 0 评论 -
HDU1106
[url]http://acm.hdu.edu.cn/showproblem.php?pid=1106[/url][code="java"]#include #include #include #define MAXN 1005char Number[MAXN];long sort[MAXN];int cmp(const void *a, const v...原创 2011-07-01 23:17:46 · 88 阅读 · 0 评论 -
HDU2036改革春风吹满地
改革春风吹满地Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7455 Accepted Submission(s): 3738Problem Description“ 改革春风吹满地,不会AC没关系;...原创 2011-08-02 16:08:42 · 76 阅读 · 0 评论 -
HDU2055An easy problem
An easy problemTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5908 Accepted Submission(s): 4106Problem Descriptionwe define f(A)...原创 2011-08-05 09:51:47 · 110 阅读 · 0 评论 -
HDU2057A + B Again
A + B AgainTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6483 Accepted Submission(s): 2825Problem DescriptionThere must be many...原创 2011-08-12 00:09:36 · 134 阅读 · 0 评论 -
HDU2068RPG的错排
RPG的错排Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2911 Accepted Submission(s): 1192Problem Description今年暑假杭电ACM集训队第一次组成女生队,其中...原创 2011-08-10 22:45:03 · 85 阅读 · 0 评论 -
HDU2080
角有多大IITime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3238 Accepted Submission(s): 1536Problem Description这次xhd面临的问题是这样的:在一个平面内有两...原创 2011-08-10 01:05:15 · 90 阅读 · 0 评论 -
HDU2058
The sum problemTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6675 Accepted Submission(s): 2066Problem DescriptionGiven a sequen...原创 2011-08-10 00:48:05 · 73 阅读 · 0 评论 -
HDU2085核反应堆
核反应堆Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4364 Accepted Submission(s): 2016Problem Description某核反应堆有两类事件发生:高能质点碰击核子时,...原创 2011-08-09 18:03:12 · 400 阅读 · 0 评论 -
HDU2087剪花布条
剪花布条Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2876 Accepted Submission(s): 1925Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条...原创 2011-08-09 17:49:15 · 160 阅读 · 0 评论 -
HDU2028Lowest Common Multiple Plus
Lowest Common Multiple PlusTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13323 Accepted Submission(s): 5486Problem Description求...原创 2011-08-09 15:30:04 · 107 阅读 · 0 评论 -
HDU2022海选女主角
海选女主角Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13125 Accepted Submission(s): 6109Problem Descriptionpotato老师虽然很喜欢教书,但是迫于生活压...原创 2011-08-09 14:45:24 · 96 阅读 · 0 评论 -
HDU2021
发工资咯:)Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11938 Accepted Submission(s): 6844Problem Description作为杭电的老师,最盼望的日子就是每月的8号了...原创 2011-08-09 14:28:36 · 109 阅读 · 0 评论 -
HDU2015
偶数求和Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17853 Accepted Submission(s): 7718Problem Description有一个长度为n(n...原创 2011-08-09 14:01:01 · 85 阅读 · 0 评论 -
HDU2005
第几天?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 27221 Accepted Submission(s): 10521Problem Description给定一个日期,输出这个日期是该年的第几天。...原创 2011-08-09 13:33:58 · 142 阅读 · 0 评论 -
HDU1870愚人节的礼物
愚人节的礼物Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1489 Accepted Submission(s): 932Problem Description四月一日快到了,Vayko想了个愚人的好办法——...原创 2011-08-08 12:56:37 · 74 阅读 · 0 评论 -
HDU1237简单计算器
简单计算器Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6400 Accepted Submission(s): 2030Problem Description读入一个只包含 +, -, *, / 的非负整数...原创 2011-08-08 10:28:45 · 515 阅读 · 0 评论 -
HDU2035
人见人爱A^BTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7596 Accepted Submission(s): 5452Problem Description求A^B的最后三位数表示的整数。说明:A...原创 2011-06-26 20:49:22 · 246 阅读 · 0 评论 -
阶乘的精确值
输入一个不超过1000的正整数n,输出n!简单输入:30简单输出:265252859812191058636308480000000[code="java"]#include #include #define MAXN 3000int f[MAXN];//算法分析:由于数据不超过1000,则最大为1000,而1000的阶乘那是很大的,...原创 2011-06-22 20:56:46 · 102 阅读 · 0 评论 -
小学生算术
描述: 很多学生学习加法的时,发现“进位”特别容易出错,你的任务是计算两个数,在相加时需要多少次进位.你编写的程序应当可以连续的处理多组数据,直到读到两个连续的0(这是输入结束标记),假设输入的整数不超过9个数字简单输入:123 456555 555123 5940 0简单输出:031[code="java"]#include...原创 2011-06-22 20:33:06 · 82 阅读 · 0 评论 -
HDU1166(敌兵布阵)
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9597 Accepted Submission(s): 4072Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国...原创 2011-09-17 12:55:22 · 105 阅读 · 0 评论 -
HDU1754 I Hate It
参考资料:[url]http://www.cppblog.com/MiYu/archive/2010/08/29/125199.html[/url]此题的simple建立的树为:[img]http://dl.iteye.com/upload/attachment/555550/5058a6dd-47dc-3329-b201-dffeaf7b056c.jpg[/img]AC代码:...原创 2011-09-16 23:40:46 · 106 阅读 · 0 评论 -
HDU1686Oulipo
OulipoTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1554 Accepted Submission(s): 587Problem DescriptionThe French author George...原创 2011-09-14 22:15:33 · 114 阅读 · 0 评论 -
HDU2100Lovekey
LovekeyTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2812 Accepted Submission(s): 929Problem DescriptionXYZ-26进制数是一个每位都是大写字母的数字...原创 2011-09-12 17:16:51 · 79 阅读 · 0 评论 -
HDU3368 Reversi(黑白棋)
ReversiTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 591 Accepted Submission(s): 251Problem DescriptionReversi, also called Oth...原创 2011-09-11 23:04:32 · 200 阅读 · 0 评论 -
HDU1010Tempter of the Bone
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26363 Accepted Submission(s): 7218Problem DescriptionThe doggi...原创 2011-09-11 23:02:28 · 106 阅读 · 0 评论 -
求一个集合的全排列
[code="java"]#include using namespace std;const int _N = 10000;int d[_N], p[_N];bool flag[_N];int n;void dfs(int pos){ int i; if(pos == n) { for(i = 0; i < n; i++) cou...原创 2011-09-11 14:49:21 · 174 阅读 · 0 评论 -
HDU1175连连看
连连看Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6496 Accepted Submission(s): 1660Problem Description“连连看”相信很多人都玩过。没玩过也没关系,下面...原创 2011-09-09 23:24:50 · 113 阅读 · 0 评论