摘要: Wow! Such Conquering! Problem Description There are n Doge Planets in the Doge Space. The conqueror of Doge Space is Super Doge, who is going to inspe 阅读全文
posted @ 2014-08-18 00:13 ForeverEnjoy 阅读(420) 评论(0) 推荐(0)
摘要: Tunnels Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 844 Accepted Submission(s): 249 Problem 阅读全文
posted @ 2014-08-18 00:05 ForeverEnjoy 阅读(407) 评论(0) 推荐(0)
摘要: poj 3237 tree inline : 1. inline 定义的类的内联函数,函数的代码被放入符号表中,在使用时直接进行替换,(像宏一样展开),没有了调用的开销,效率也很高。 2. 很明显,类的内联函数也是一个真正的函数,编译器在调用一个内联函数时,会首先检查它的参数的类型,保证调用正确。然 阅读全文
posted @ 2014-08-17 00:04 ForeverEnjoy 阅读(186) 评论(0) 推荐(0)
摘要: The Subtle Balloons Company (SBC) is the main balloon provider for programming contests; it hashuge factories and warehouses, as well as an extensive 阅读全文
posted @ 2014-08-14 01:28 ForeverEnjoy 阅读(466) 评论(0) 推荐(0)
摘要: 今天这场打的还不错吧,就是开场一个小时就WA在两道水题上了,今天的题总体上比原先的个人赛水多了,有点喜剧性吧,就 像这个一样 ,其实我也挺喜欢听小苹果的,虽然一开始骂这是一首破歌。 今天看到A题CodeForces 205B,好开心,这不是可以用昨天那道ZOJ 2243 treap用线段树解决的方法解决。开心的打完代码, 想着我实在太聪明了,可是,但我提交的时候发现,好吧,我又把一道题复杂话了,W... 阅读全文
posted @ 2014-08-12 00:16 ForeverEnjoy 阅读(206) 评论(0) 推荐(0)
摘要: 今天又爆零了,又是又,怎么又是又,爆零爆多了,又也就经常挂嘴边了,看到这句话,你一定很想说一句””,弱菜被骂傻,也很正常啦。如果你不开心,可以考虑往下看。翻到E(HDU 4635 Strongly connected)题,这么短的题目,肯定要先看啦。然后D(LightOJ 1229),然后C(ZOJ... 阅读全文
posted @ 2014-08-10 22:48 ForeverEnjoy 阅读(283) 评论(0) 推荐(0)
摘要: Cool Points We have a circle of radius R and several line segments situated within the circumference of this circle. Let’s define a cool point to be a 阅读全文
posted @ 2014-08-10 10:47 ForeverEnjoy 阅读(160) 评论(0) 推荐(0)
摘要: UVA 12657Boxes in a Line 模拟 FZU 1876JinYueTuan 不说话 view code#include using namespace std; int main() { long long n,m,p,ans=1; while(cin>>n>>m>>p){ ans=1; for(int i=n;i #in... 阅读全文
posted @ 2014-08-09 00:03 ForeverEnjoy 阅读(156) 评论(0) 推荐(0)
摘要: 题意:给定一些木棒,木棒两端都涂上颜色,求是否能将木棒首尾相接,连成一条直线,要求不同木棒相接的一边必须是相同颜色的。 无向图存在欧拉路的充要条件为: ① 图是连通的; ② 所有节点的度为偶数,或者有且只有两个度为奇数的节点。 图的连通可以利用并查集去判断。 度数的统计比较容易。 代码实现 //第一次用指针写trie,本来是用二维数组,发现数组开不下,只好删... 阅读全文
posted @ 2014-08-08 10:55 ForeverEnjoy 阅读(152) 评论(0) 推荐(0)
摘要: FZU 2079 最大获利(dp) 自己很难想到,囧 dp[i]表示处理完前i 个点的最大收益。有两种情况:(1)第i 个点不投资,那么dp[i] = dp[i - 1](2)第i 个点投资,那么dp[i] = max(dp[k] + get(k + 1,i) - sigma(c[j]) (k + 1 #include #include #include #include using ... 阅读全文
posted @ 2014-08-08 00:06 ForeverEnjoy 阅读(187) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2014-08-07 11:12 ForeverEnjoy 阅读(2) 评论(0) 推荐(0)
摘要: KMP,在有循环节的前提下: 循环节 t = len-next[len], 个数num = len/(len-next[len]);个人理解,如果有循环节,循环节长度必定小于等于len/2, 换句话说next[len]>=len/2;对于len%(len-next)!=0的这种情况不讨论,循环节不存在。下面是假设循环节存在的情况当次数等于2, 对于abcabc这种情况就不用说了,len = 6,... 阅读全文
posted @ 2014-08-07 10:46 ForeverEnjoy 阅读(183) 评论(0) 推荐(0)
摘要: hdu 3374 String Problem 最小表示法 view code#include #include #include #include #include #include using namespace std; const int N = 10010; int n; char s[105]; mapma; void getminsub(char *s) { ... 阅读全文
posted @ 2014-08-07 09:29 ForeverEnjoy 阅读(185) 评论(0) 推荐(0)
摘要: 这次比赛有显示了自己的不足,之所以是又,是因为基本上每次都暴露了自己很水,囧。 剩下的时间努力刷题,加油 CodeForces 287B Pipeline (二分加贪心) view code#include #include #include #include #include using namespace std; typedef long long ll; ll n, m; l... 阅读全文
posted @ 2014-08-06 23:17 ForeverEnjoy 阅读(186) 评论(0) 推荐(0)
摘要: 哈佛校园里,不见华服,不见化妆,更不见晃里晃荡,只有匆匆的脚步,坚实地写下人生的篇章。 哈佛不是神话,哈佛只是一个证明,人的意志,精神,抱负,理想的证明。 日前,两张美国哈佛大学图书馆凌晨4点多学生仍在学习的照片,在网上迅速传播。 照片显示:凌晨4点的哈佛大学图书馆里,灯火通明,座无虚席... 阅读全文
posted @ 2014-08-06 21:43 ForeverEnjoy 阅读(254) 评论(0) 推荐(0)