hiho week 21 register

Ended

Participants:248

Verdict:Accepted
Score:100 / 100
Submitted:2014-11-25 17:01:16

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 <cstdio>
#include <cstring>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
#define lson o<<1
#define rson o<<1|1
const int maxn = 1e5 + 10;
int setv[maxn<<2];
int x[maxn];
int y[maxn];
int pos[maxn<<2];
int n, L;
int Bin(int key){
    int l = 1, r = n;
    while(l <= r){
        int m = (l + r)>>1;
        if(pos[m] == key)return m;
        if(pos[m] < key) l = m + 1;
        else r = m - 1;
    }
    return -1;
}
void build_tree(int o, int l, int r){
    int m = (l + r)>>1;
    setv[o] = 0;
    if(l == r - 1)return ;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX