自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 收藏
  • 关注

原创 hdoj1159 (dp 最长公共子序列)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1159Common SubsequenceProblem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left ou

2013-11-29 22:03:52 576

原创 hdoj1176 免费馅饼 (DP)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1176免费馅饼Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy

2013-11-27 23:48:51 360

原创 hdoj1466 计算直线的交点数 ( DP )

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1466计算直线的交点数Problem Description平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。 Input输入数据包含多个测试实例,每个测试实例占一行,每行包

2013-11-27 22:35:20 604

原创 hdoj1160 FatMouse's Speed ( STL + 最长下降子序列 /DP)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1160FatMouse's Speed             Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)               Total Submissi

2013-11-27 19:13:36 570

原创 hdoj2577 How to Type ( DP水题 )

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2577How to TypeProblem DescriptionPirates have finished developing the typing software. He called Cathy to test his typing software. She is g

2013-11-26 19:39:11 583

原创 hdoj2084 数塔 (DP水题)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2084数塔Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗?

2013-11-26 16:11:19 581

原创 hdoj2151 Worm ( DP )

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2151WormProblem Description自从见识了平安夜苹果的涨价后,Lele就在他家门口水平种了一排苹果树,共有N棵。突然Lele发现在左起第P棵树上(从1开始计数)有一条毛毛虫。为了看到毛毛虫变蝴蝶的过程,Lele在苹果树旁观察了很久。虽然没有看到蝴蝶,但

2013-11-26 15:23:31 586

原创 hdoj2059 龟兔赛跑 (dp)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2059龟兔赛跑Problem Description据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一直想找机会

2013-11-21 13:18:06 688

原创 hdoj1421 搬寝室 (dp)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1421搬寝室Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬

2013-11-21 07:43:50 596

原创 hdoj1356 The Balance (扩展欧几里德)

题目: http://acm.hdu.edu.cn/showproblem.php?pid=1356题意:Sample Input700 300 200500 200 300500 200 500275 110 330275 110 385648 375 40023 1 100000 0 0 Sample Output

2013-11-20 23:25:49 700

原创 hdoj2837 Calculation (费马小定理+递归+欧拉函数)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2837CalculationProblem DescriptionAssume that f(0) = 1 and 0^0=1. f(n) = (n%10)^f(n/10) for all n bigger than zero. Please calculate f(n)%m

2013-11-14 11:59:45 667

原创 hdoj1709 The Balance (母函数)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1709The BalanceProblem DescriptionNow you are asked to measure a dose of medicine with a balance and a number of weights. Certainly it is not

2013-11-12 21:43:05 511

原创 hdoj1028 Ignatius and the Princess III (母函数-整数拆分)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1028Ignatius and the Princess IIIProblem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are la

2013-11-12 20:50:33 703

原创 hdoj4704 Sum ( 费马小定理 )

题目:http://acm.hdu.edu.cn/showproblem.php?pid=4704SumProblem Description Sample Input2 Sample Output2Hint1. For N = 2, S(1) = S(2) = 1.2. The input file

2013-11-12 06:50:57 582

转载 hdoj4699 (stack)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=4699Sample Input8I 2I -1I 1Q 3LDRQ 2 Sample Output23HintThe following diagram shows the status of sequence after each

2013-11-07 12:31:14 503

原创 hdoj1032 ( 线段树-区间查询)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1032The 3n + 1 problemProblem DescriptionProblems in Computer Science are often classified as belonging to a certain class of problems (e.g

2013-11-06 13:16:04 662

原创 codechef (大数据素数筛法)

题目:http://www.codechef.com/NOV13/problems/PRETNUM/Yet Another Cute Girl思路:一个数的因子的个数为素数,即这个数等于一个素数的n次方,并且n+1为素数。L和R的最大值为10^12,要判断大数为素数,也可以用筛法,先把10^6内的素数打表,然后分别把这些素

2013-11-05 21:08:22 1134

原创 hdoj1022 Train Problem I ( stack )

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1022Train Problem IProblem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get

2013-11-05 12:48:47 640

原创 hdoj4268 Alice and Bob (multiset +贪心)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=4268题意:女生和男生各有n张牌,牌的高和宽分别为h,w,当女生的牌的高和宽分别大于等于男生的高和宽时表示女生的牌可以覆盖男生的牌,问女生最多可以覆盖多少张男生的牌,进行了覆盖组合的两张牌不可重复使用。思路:先用两个结构体分别存女生和男生的数据,先h再w 都从小到大排序,然后贪心,从小到大枚举女

2013-11-05 10:46:39 785

原创 hdoj1106 ( strtok函数 )

strtok原型:char *strtok(char s[], const char *delim);功能:分解字符串为一组字符串。s为要分解的字符串,delim为分隔符字符串。例如:strtok("abc,def,ghi",","),最后可以分割成为abc def ghi.尤其在点分十进制的IP中提取应用较多。说明:strtok()用来

2013-11-05 06:44:55 593

原创 poj2643 Election (map)

题目:http://poj.org/problem?id=2643OutputOutput consists of a single line containing one of: The name of the party with whom the winning candidate is associated, if there is a winning candid

2013-11-02 08:32:29 549

原创 poj 2503 Babelfish (map / 二分)

题目:http://poj.org/problem?id=2503Sample Inputdog ogdaycat atcaypig igpayfroot ootfrayloops oopslayatcayittenkayoopslaySample Outputcatehloops题意:字典里每行两个单词,第一个为解释,第二个为原词,两词之间用空格

2013-11-01 07:47:53 555

转载 sscanf

名称:  sscanf() - 从一个字符串中读进与指定格式相符的数据.  函数原型:  Int sscanf( string str, string fmt, mixed var1, mixed var2 ... );  int scanf( const char *format [,argument]... );  说明:  sscanf与sca

2013-11-01 07:07:31 576

原创 hdoj1896 Stones (priority_queue)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1896Sample Input221 52 421 56 6 Sample Output1112题意:有T个case,n个石头,每个石头有一对性质(a,b),a石头现在的位置,b为石头可以从当前位置被抛出的距离,当小伙伴遇到第

2013-11-01 00:51:04 627

转载 hdoj1509 Windows Message Queue (优先队列)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=1509Sample InputGETPUT msg1 10 5PUT msg2 10 4GETGETGET Sample OutputEMPTY QUEUE!msg2 10msg1 10EMPTY QUEUE!题意:数据库

2013-11-01 00:42:49 558

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除