2014年8月6日

hdu 2647

摘要: RewardTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4093Accepted Submission(s): 1240Problem Desc... 阅读全文

posted @ 2014-08-06 23:46 天凉了 阅读(222) 评论(0) 推荐(0) 编辑

hdu 3342

摘要: Legal or NotTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4322Accepted Submission(s): 1926Proble... 阅读全文

posted @ 2014-08-06 23:43 天凉了 阅读(141) 评论(0) 推荐(0) 编辑

hdu 4324

摘要: Triangle LOVETime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2478Accepted Submission(s): 1011Probl... 阅读全文

posted @ 2014-08-06 23:37 天凉了 阅读(140) 评论(0) 推荐(0) 编辑

2014年8月5日

hdu 4911 Inversion

摘要: InversionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 68Accepted Submission(s): 23Problem Des... 阅读全文

posted @ 2014-08-05 18:06 天凉了 阅读(445) 评论(0) 推荐(0) 编辑

2014年8月4日

hdu 2836 Traversal

摘要: TraversalTime Limit: 2000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 722Accepted Submission(s): 268Problem Des... 阅读全文

posted @ 2014-08-04 19:06 天凉了 阅读(183) 评论(0) 推荐(0) 编辑

hdu 4031 Attack

摘要: AttackTime Limit: 5000/3000 MS (Java/Others)Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 1734Accepted Submission(s): 506Problem Descr... 阅读全文

posted @ 2014-08-04 12:52 天凉了 阅读(124) 评论(0) 推荐(0) 编辑

2014年8月3日

uva 11610 Reverse Prime

摘要: Problem FReverse PrimeInput:Standard InputOutput:Standard OutputThere are a few 7 digit positive numbers whose reverse number is a prime number and le... 阅读全文

posted @ 2014-08-03 22:45 天凉了 阅读(580) 评论(0) 推荐(0) 编辑

hdu 2852 KiKi's K-Number

摘要: L -KiKi's K-NumberTime Limit:2000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionFor the k-th number, we all should be very ... 阅读全文

posted @ 2014-08-03 22:27 天凉了 阅读(131) 评论(0) 推荐(0) 编辑

poj 1990 mooFest

摘要: I -MooFestTime Limit:1000MSMemory Limit:30000KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionEvery year, Farmer John's N (1 2 #include 3 #inclu... 阅读全文

posted @ 2014-08-03 22:05 天凉了 阅读(144) 评论(0) 推荐(0) 编辑

poj 2481 Cows

摘要: E -CowsTime Limit:3000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionFarmer John's cows have discovered that the clover gro... 阅读全文

posted @ 2014-08-03 21:46 天凉了 阅读(123) 评论(0) 推荐(0) 编辑

poj 1195 Mobile phones

摘要: C -Mobile phonesTime Limit:5000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionSuppose that the fourth generation mobile pho... 阅读全文

posted @ 2014-08-03 21:37 天凉了 阅读(101) 评论(0) 推荐(0) 编辑

poj 3067 japan

摘要: B -JapanTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionJapan plans to welcome the ACM ICPC World Finals and ... 阅读全文

posted @ 2014-08-03 18:28 天凉了 阅读(169) 评论(0) 推荐(0) 编辑

hdu 1541 Stars

摘要: A -StarsTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uDescriptionAstronomers often examine star maps where stars are represented b... 阅读全文

posted @ 2014-08-03 18:17 天凉了 阅读(336) 评论(0) 推荐(0) 编辑

2014年8月1日

hdu 4465 Candy

摘要: 题意:有两个箱子,每个箱子里面都有n个糖果,每次LazyChild会选一个箱子,并吃掉一个糖果,如果里面没有糖果,则去另一个箱子去吃LazyChild 选第一个箱子的概率为 p,选择第二个箱子的概率为q=1-p求:当LazyChild选择一个箱子时,里面没有糖果了,另一个箱子里糖果数量的期望因为要使... 阅读全文

posted @ 2014-08-01 13:56 天凉了 阅读(119) 评论(0) 推荐(0) 编辑

2014年7月31日

poj 2151 Check the difficulty of problems

摘要: dp[i][j][s]表示第i个人,在前j个问题解决了s个问题dp[i][j][s]=dp[i][j-1][s-1]*p[i][j]+dp[i][j-1][s]*(1-p[i][j]); 1 #include 2 #include 3 #include 4 #include 5 #include 6... 阅读全文

posted @ 2014-07-31 23:04 天凉了 阅读(96) 评论(0) 推荐(0) 编辑

cf 148D Bag of mice

摘要: The dragon 选一只老鼠,然后会跑掉一只the princess选一只老鼠,不会跑出另外的老鼠求the princess赢的概率 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #i... 阅读全文

posted @ 2014-07-31 22:21 天凉了 阅读(127) 评论(0) 推荐(0) 编辑

poj 3071 Football

摘要: 题意:有2^n支队伍进行比赛,每行给出这支队伍打败各支队伍的几率,求获胜几率最大的队伍 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 #incl... 阅读全文

posted @ 2014-07-31 22:10 天凉了 阅读(128) 评论(0) 推荐(0) 编辑

sgu 495 Kids and Prizes

摘要: 计算出每个人得到礼物的概率,然后加起来即可 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 double dp[101010]; 7 int main(){ 8 int n,m; 9 while... 阅读全文

posted @ 2014-07-31 21:42 天凉了 阅读(231) 评论(0) 推荐(0) 编辑

hdu 4336 Card Collector

摘要: 有n种卡片,概率分别为p1...pn,p1+...+pn 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 using namespace std;11 #define ... 阅读全文

posted @ 2014-07-31 20:46 天凉了 阅读(117) 评论(0) 推荐(0) 编辑

zoj 3329 One Person Game

摘要: 原文地址:http://www.cnblogs.com/kuangbin/archive/2012/10/03/2710648.html/*ZOJ 3329题意:有三个骰子,分别有k1,k2,k3个面。每次掷骰子,如果三个面分别为a,b,c则分数置0,否则加上三个骰子的分数之和。当分数大于n时结束。... 阅读全文

posted @ 2014-07-31 19:37 天凉了 阅读(157) 评论(0) 推荐(0) 编辑

poj 2096 Collecting Bugs

摘要: 题意:一个新项目里面,有n种bugs,有s 个subcomponents,找出的一个bug属于n个bugs里的某一种的概率为 1/n;找出的一个bug属于m个subcomponentsde里的某一种的概率为 1/m求每种bugs至少找出一个bug,每种subcomponents找出一个bug的次数期... 阅读全文

posted @ 2014-07-31 14:15 天凉了 阅读(216) 评论(0) 推荐(0) 编辑

poj 3744 Scout YYF I

摘要: 题意:有 n个雷,分别在 a[0]...a[n-1],走一步概率为p,走两步概率为1-p,初始位置为1,问安全到达终点的概率。因为位置范围比较大【1, 100000000】,所以可以把 相邻的两个地雷之间的概率用矩阵快速幂计算[ a(i) a(i+1) ] *| 0 1-p |=[ a(i+1) a... 阅读全文

posted @ 2014-07-31 10:47 天凉了 阅读(203) 评论(0) 推荐(0) 编辑

2014年7月19日

HDU 2196 Computer

摘要: 第一次dfs求出每个点的最大和次大长度,由下向上更新第二次由上向下更新。第二次dfs是为了处理某个点,最大长度不是向子节点延伸的长度,而是从父亲节点过来的 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include ... 阅读全文

posted @ 2014-07-19 15:09 天凉了 阅读(178) 评论(0) 推荐(0) 编辑

HDU 1520 Anniversary party

摘要: 题目意思:有n个人,他们的关系是一棵树,每个人有一个欢乐度,举行一个聚会,邀请个人里的一些人,但是如果两个人的关系是上下级,他们最多一个被邀请int dp[][2] dp[][0]表示不邀请这个人得到的最大欢乐度,dp[][1]表示邀请这个人得到的最大欢乐度 1 #include 2 #incl... 阅读全文

posted @ 2014-07-19 15:03 天凉了 阅读(129) 评论(0) 推荐(0) 编辑

2014年7月16日

POJ 1217 FOUR QUARTERS

摘要: 题目意思是,AB两个人掷硬币,每次一个人掷两次,然后对应图标里面得分,要你输出前20回合 A赢,B赢,或是平均的概率dp还是不怎么会,参考别人代码才敲出来的 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #in... 阅读全文

posted @ 2014-07-16 15:24 天凉了 阅读(371) 评论(0) 推荐(0) 编辑

2014年7月15日

POJ 2184 Cow Exhibition

摘要: 这题有两个费用,一个是聪明度s,另一个是幽默度f。可以把其中一个当做体积,另一个当做价值,因为有负数的原因,当做体积的那一个加上1000dp[i]用来表示体积为i 的最大价值自己在敲的时候,更新的时候出了问题 1 for(j=mmax; j>=a; j--) 2 i... 阅读全文

posted @ 2014-07-15 15:16 天凉了 阅读(132) 评论(0) 推荐(0) 编辑

HDU 2639 Bone Collector II

摘要: 对每一个容量都存取kk个价值,加入新的价值之后,进行排序,取前kk个价值(从大到小)。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 #incl... 阅读全文

posted @ 2014-07-15 13:00 天凉了 阅读(155) 评论(0) 推荐(0) 编辑

POJ 3181 Dollar Dayz

摘要: 一开始看到题目,就写了一个完全背包,然后一直wa,百度一下,蛋疼的是 结果是大数模拟高精度 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 #in... 阅读全文

posted @ 2014-07-15 09:48 天凉了 阅读(119) 评论(0) 推荐(0) 编辑

2014年7月14日

POJ 1787 Charlie's Change

摘要: 这题背包要记录路径,然后自己写了一个,感觉有点繁琐 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 u... 阅读全文

posted @ 2014-07-14 22:04 天凉了 阅读(106) 评论(0) 推荐(0) 编辑

POJ 2063 Investment

摘要: 思路:因为每年存款的利息不变,所以第二年的本金是第一年的本息和,以此类推#include#include#include#include#include#include#include#include#include#includeusing namespace std;#define inf 10... 阅读全文

posted @ 2014-07-14 20:07 天凉了 阅读(121) 评论(0) 推荐(0) 编辑

HDU 1114 Piggy-Bank

摘要: 简单的背包#include#include#include#include#include#include#include#include#include#includeusing namespace std;#define inf 10000000int main(){ int t,e,f,... 阅读全文

posted @ 2014-07-14 19:33 天凉了 阅读(143) 评论(0) 推荐(0) 编辑

2014年3月18日

Lca hdu 2874 Connections between cities

摘要: Connections between citiesTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3937Accepted Submission(s): 1144Problem DescriptionAfter World War X, a lot of cities have been seriously damaged, and we need to rebuild those cities. However, some materia 阅读全文

posted @ 2014-03-18 21:14 天凉了 阅读(152) 评论(0) 推荐(0) 编辑

2014年2月12日

hdu 1535 Invitation Cards

摘要: Invitation CardsTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1626Accepted Submission(s): 729Problem DescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They 阅读全文

posted @ 2014-02-12 14:42 天凉了 阅读(179) 评论(0) 推荐(0) 编辑

2013年11月27日

hdu 3172 并查集

摘要: Virtual FriendsTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3244Accepted Submission(s): 945http://acm.hdu.edu.cn/showproblem.php?pid=3172Problem DescriptionThese days, you can do all sorts of things online. For example, you can use various websi 阅读全文

posted @ 2013-11-27 20:40 天凉了 阅读(193) 评论(0) 推荐(0) 编辑

2013年11月19日

sicily 9360 vector

摘要: 9360. HIPERCIJEVITotal:104Accepted:21Rating:UnratedTime Limit: 4sec Memory Limit:256MBDescriptionInagalaxyfar,faraway,thefastestmethodoftransportationisusinghypertubes.EachhypertubedirectlyconnectsKstationswitheachother.Whatistheminimumnumberofstationsthatweneedtopassthroughinordertogetfromstation1. 阅读全文

posted @ 2013-11-19 20:44 天凉了 阅读(422) 评论(0) 推荐(0) 编辑

hdu 2112 最短路spfa

摘要: HDU TodayTime Limit: 15000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11598Accepted Submission(s): 2705http://acm.hdu.edu.cn/showproblem.php?pid=2112Problem Description经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强。这时候,XHD夫妇也退居了二线,并在风 阅读全文

posted @ 2013-11-19 20:22 天凉了 阅读(376) 评论(0) 推荐(0) 编辑

hdu 1690 最短路floyd

摘要: Bus SystemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5686Accepted Submission(s): 1441http://acm.hdu.edu.cn/showproblem.php?pid=1690Problem DescriptionBecause of the huge population of China, public transportation is very important. Bus is an i 阅读全文

posted @ 2013-11-19 20:18 天凉了 阅读(156) 评论(0) 推荐(0) 编辑

2013年10月23日

hdu 2639 第k大背包

摘要: Bone Collector IITime Limit: 5000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1682Accepted Submission(s): 863Problem DescriptionThe title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have 阅读全文

posted @ 2013-10-23 11:01 天凉了 阅读(120) 评论(0) 推荐(0) 编辑

2013年10月20日

hdu 1712 分组背包

摘要: ACboy needs your helpTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3124Accepted Submission(s): 1623Problem DescriptionACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different co 阅读全文

posted @ 2013-10-20 14:51 天凉了 阅读(230) 评论(0) 推荐(0) 编辑

2013年10月18日

hdu 2159 二维费用背包

摘要: FATETime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6029Accepted Submission(s): 2773Problem Description最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐 阅读全文

posted @ 2013-10-18 15:12 天凉了 阅读(185) 评论(0) 推荐(0) 编辑

导航