hiho week 21 register

Ended

Participants:248

Verdict:Accepted
Score:100 / 100
Submitted:2014-11-24 15:56:09

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<stdio.h>
#include<cmath>
#include<map>
#include<string>
#include<string.h>
#include<algorithm>
#define MAXN 400005
#define oo 1000000007
#define ll long long
using namespace std;   
int P[MAXN][2],id[MAXN],T[MAXN<<2],col[MAXN<<2];
bool F[MAXN];
int find(int d,int n)
{
       int l=0,r=n+1,mid;
       while (r-l>1)
       {
               mid=l+r>>1;
               if (id[mid]<=d) l=mid;
                          else r=mid;
       }
       return l;
} 
void PushDown(int x)
{
       if (!col[x]) return;
       T[x<<1]=T[x<<1|1]=col[x];
       col[x<<1]=col[x<<1|1]=col[x];
       col[x]=0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX