HDU 1410 PK武林盟主】的更多相关文章

Problem Description 枫之羽认为自己很强,想当武林盟主,于是找现任武林盟主氢氧化铜挑战.氢氧化铜欣然接受了挑战,两人约好于下个月的月圆之夜在HDU校园内的三根柱子上进行决战.这场PK赛肯定能吸引武林中所有人前来观战,所以他们找了有商业运作潜力的经济人你,让你来组织这场百年一见的世纪之战,假设两人都有一定的血HP1.HP2.HP1是枫之羽的,HP2是氢氧化铜的.他们也有一定攻击力AP1.AP2,AP1是枫之羽的,AP2是氢氧化铜的.当进行攻击时,对方的HP减少自己的攻击力,比如H…
Ref : http://www.clanfei.com/2012/04/772.html 可推出公式: ans=sigma[C(N1-1,i)*0.5^(N1+i)] (0<=i<=N2-1) 注意double相乘会掉精度导致WA,所以要用黑科技: log(a*b)=log(a)+log(b) 10^(log(a))=a 这样就把乘法转成加法辣~ #include<iostream> #include<cmath> #include<cstdio> usi…
Intersection Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 13528   Accepted: 3521 Description You are to write a program that has to decide whether a given line segment intersects a given rectangle. An example: line: start point: (4,9)…
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012.1013.1014.1017.1019.1021.1028.1029. 1032.1037.1040.1048.1056.1058.1061.1070.1076.1089.1090.1091.1092.1093. 1094.1095.1096.1097.1098.1106.1108.1157.116…
(转)http://blog.csdn.net/u013081425/article/details/39240021 http://acm.hdu.edu.cn/showproblem.php?pid=4418 读了一遍题后大体明白意思,但有些细节不太确定.就是当它处在i点处,它有1~m步可以走,但他走的方向不确定呢.后来想想这个方向是确定的,就是他走到i点的方向,它会继续朝着这个方向走,直到转向回头. 首先要解决的一个问题是处在i点处,它下一步该到哪个点.为了解决方向不确定的问题,将n个点转…
hdu 4967 Handling the Past view code//把时间离散化,维护一个线段(线段l到r的和用sum[l,r]表示),pop的时候就在对应的时间减一,push则相反 //那么每次peak的时候(假设在pk是时刻),找一个以pk为结尾的后缀和,这个后缀和为1且前端离pk最近. //即sum[pu, pk]==1 且pu是最靠近pk的时间. //理解:假设sum[l,pk]==0, 那么l到pk这段时间的push和pop次数相等,对peak无影响,可以直接忽视.pu时刻就…
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 1084 1088 1106 1107 1113 1117 1119 1128 1129 1144 1148 1157 1161 1170 1172 1177 1197 1200 1201…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5446 Unknown Treasure 问题描述 On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave because it is there. Somewhere…
Unknown Treasure Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5446 Description On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician ent…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=4333 题意:给以数字字符串,移动最后若干位到最前边,统计得到的数字有多少比原来大,有多少和原来同样,有多少比原来的小. 思路:拓展KMP中的next数组标记的是子串和母串的公共前缀的长度,要将字符串长度变成原来二倍,这样假设变换后不是全然同样的数字也即公共前缀长度大于等于字符串长度,那么字母串公共前缀的下一位的大小比較就是题目所要求的比較.因为同样的数字串仅仅算一次,则仅仅要统计比較第一个"循环节&qu…