码迷,mamicode.com
首页 >  
搜索关键字:离散化    ( 1590个结果
【莫队算法】【权值分块】bzoj3585 mex
orz PoPoQQQ。本来蒟蒻以为这种离散化以后就对应不起来的题不能权值分块搞的说。……结果,实际上>n的权值不会对答案作出贡献。#include#include#includeusing namespace std;#define N 200002#define BN 452int n,m,nu...
分类:编程语言   时间:2015-03-10 19:02:19    阅读次数:246
DFS染色解决区域分块问题UVALive 6663
怪我比赛的时候想法太过于杂乱了。注重于区域的属性了。甚至还想用状态压缩或者是hash来描述分块的区域。其实我们的可以宏观的角度去审视这个问题。就是求分区的问题。那么我们完全可以标记边框的值为1。即不可行走。那么我们扫描整片区域。统计一个区域 。就用DFS把这整片区域给覆盖。然后继续扫描下去。离散化在...
分类:其他好文   时间:2015-03-09 01:42:38    阅读次数:184
HDU 1542
每次添加,计算出被覆盖的长度,离散化X坐标,按Y坐标排序加入即可。今天好伤心,我好水。。。。#include #include #include #include using namespace std; #define lson l , m , rt > 1; if (...
分类:其他好文   时间:2015-03-07 22:30:08    阅读次数:210
【POJ2266】【树状数组+离散化】Ultra-QuickSort
DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping ...
分类:编程语言   时间:2015-03-07 09:03:43    阅读次数:160
伸展树总结
最近做的一些Splay题及思路 BZOJ 1588 就是求一个数的前驱和后继,用Splay很简单 POJ 3468  很经典的线段树题目,用Splay做练习懒惰标记 HDU 1890  涉及区间翻转,注意直接以数列下标建树,对原数列排序后,直接查找,找到后删除。 HDU 3436  很好的一道题,首先离散化,Splay 树中每个节点表示的是一段区间...
分类:其他好文   时间:2015-03-06 22:15:03    阅读次数:287
[BZOJ 3196] 213平衡树 【线段树套set + 树状数组套线段树】
题目链接:BZOJ - 3196题目分析区间Kth和区间Rank用树状数组套线段树实现,区间前驱后继用线段树套set实现。为了节省空间,需要离线,先离散化,这样需要的数组大小可以小一些,可以卡过128MB = =嗯就是这样,代码长度= =我写了260行......Debug了n小时= =代码#inc...
分类:编程语言   时间:2015-03-06 19:06:29    阅读次数:271
POJ 2528
这题和上题一样,但要注意,这题专业反人类反STL,用map离散化TLE。。#include #include #include #include #include #include #include #include #include #include #define LL __int64usin....
分类:其他好文   时间:2015-03-05 19:19:43    阅读次数:141
离散化
vector V;int N;int a[MAXN];int x;int main () { cin >> N; REP(i,N) { cin >> x; V.push_back(make_pair(x,i)); } sort(V.begin(),V.end()); REP(i,N) a[V[...
分类:其他好文   时间:2015-03-04 19:04:26    阅读次数:169
poj 2299 Ultra-QuickSort 离散化 + 树状数组
注意离散化的写法要熟悉 树状数组这种求逆序数的方法
分类:编程语言   时间:2015-02-26 22:52:27    阅读次数:209
POJ 3613 Cow Relays (Floyd + 矩阵快速幂 + 离散化 神题!)
POJ 3613 Cow Relays (Floyd + 矩阵快速幂 + 离散化 神题!)...
分类:其他好文   时间:2015-02-24 15:12:55    阅读次数:151
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!