
块状链表
文章平均质量分 74
jinzhao1994
这个作者很懒,什么都没留下…
展开
-
[ZOJ 2112] Dynamic Rankings [块状链表+二分答案+二分查找]
两种操作,第一种操作是求区间[i,j]的第k小数,第二种操作是修改某个值把整个数组划分为长度为根号n(大概223)的块,每个块内排序,查询时二分答案,然后两端的块直接遍历,中间的块二分查找,复杂度根号n#include #include #include #include using namespace std;const int SIZE=223;int a[原创 2014-05-02 21:32:30 · 625 阅读 · 0 评论 -
[POJ 2104] K-th Number [块状链表]
求区间第k大数...想用二分答案然后块状链表做...超时了..仔细一算时间复杂度原创 2014-05-02 20:35:59 · 651 阅读 · 0 评论 -
[POJ 2887] Big String [块状链表]
给一个字符串,有两个操作:查询第i个字符,在第i个字符前加入一个其他字符可以用块状链表 以根号n为块大小,复杂度为每次操作根号n#include #include using namespace std;const int SIZE=1010;struct Node { char a[SIZE*2]; Node *next; int length; void p原创 2014-05-02 18:21:32 · 609 阅读 · 1 评论