上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页
摘要: Description There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has 阅读全文
posted @ 2017-03-12 21:57 Robin! 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Description 聪聪和可可是兄弟俩,他们俩经常为了一些琐事打起来,例如家中只剩下最后一根冰棍而两人都想吃、两个人都想玩儿电脑(可是他们家只有一台电脑)……遇到这种问题,一般情况下石头剪刀布就好了,可是他们已经玩儿腻了这种低智商的游戏。他们的爸爸快被他们的争吵烦死了,所以他发明了一个新游戏:由 阅读全文
posted @ 2017-03-12 17:18 Robin! 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Description Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and 阅读全文
posted @ 2017-03-11 23:08 Robin! 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Treap(树堆)的大部分功能STL的set都可以实现,但因为set的过度封装使得某些特定的功能不能实现,比如求第k大的值。 Code: 阅读全文
posted @ 2017-03-11 18:03 Robin! 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Problem Description 吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺序不变 阅读全文
posted @ 2017-03-11 13:47 Robin! 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 对于求最长回文子串问题,暴力解法的时间复杂度是O(n3); 好一点的算法从每个点向两边扩展也要O(n2)的复杂度; Manacher算法用p[i]数组记录以i为对称轴的回文串的右端到i的距离以及一个maxright标志,利用了回文串的对称性,使每个点只要处理一遍,因此复杂度降到了O(n)。 模板: 阅读全文
posted @ 2017-03-10 21:30 Robin! 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Description Japan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the 阅读全文
posted @ 2017-03-09 18:13 Robin! 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Description Suppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. Th 阅读全文
posted @ 2017-03-08 13:34 Robin! 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the leve 阅读全文
posted @ 2017-03-06 19:21 Robin! 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int maxn = 1000 + 5; 4 int C[maxn], n; 5 6 int lowbit(int x) {return x & -x;} 7 8 int sum(int x) { 9 int ret = 0; 10 while(x) { 11 ... 阅读全文
posted @ 2017-03-06 10:47 Robin! 阅读(189) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页