Welcome, Guest! Sign Up RSS

Clever Space

Friday, 11.22.2024
Main » 2013 » November » 01
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#define lc(x) (x<<1)
#define rc(x) ((x<<1)+1)
#define PR pair<int,int>
#define mp make_pair
#define N 300010
#define FOR(i,a,b) for(i=(a);i<=(b);i++)
#define ROF(i,a,b) for(i=(a);i>=(b);i--)
typedef long long LL;
using namespace std;
int S,Q;
struct node
{
  int l,r,lm,rm,col;
  int dis(){return r-l+1;}
  void calc()
  {
    if (col==1) lm=rm=dis();
    if (col==0) lm=rm=0;
  }
};
struct segtree
{
  node tree[3*N];
  void update(int x)
  {
    t ... Read more »
Views: 284 | Added by: dhy0077 | Date: 11.01.2013

RT

Views: 234 | Added by: dhy0077 | Date: 11.01.2013