SPOJ - DQUERY (莫队模板代码)

题目链接

 

#include
#include
#include
#include
#include
#include
#define memset(a,v)  memset(a,v,sizeof(a))
#define eps 1.0E-8
using namespace std;
const int MAXL(1e6);
const int INF(0x3f3f3f3f);
const int mod(1e9+7);
typedef long long int LL;
int cnt[MAXL+50];
int a[MAXL+50];
int res[MAXL+50];
int block;
int ans=0;
struct node
{
    int l,r,order;
    bool operator < (const node &cmp)const{
        return l/block==cmp.l/block ? rs[i].l) add(--L);
        while(Ls[i].r) del(R--);
        res[s[i].order]=ans;
    }
    for(int i=1;i<=m;i++)
        printf("%d\n",res[i]);
}

 

你可能感兴趣的:(数据结构,一些算法模板)