hiho week 21 register

Ended

Participants:248

Verdict:Accepted
Score:100 / 100
Submitted:2014-11-24 21:16:42

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 <algorithm>
#include <set>
using namespace std;
struct Node{
    int left;
    int right;
    int lazyTag;
    Node():left(-1),right(-1),lazyTag(-1){}
}segtree[524288];
int ai[100000],bi[100000],discre[200000];
int N = 0,nd = 0,sgen = 1;
set<int> ans;
int find(int val){
    int left = 0, right = nd;
    int i = (left + right) / 2; 
    while( val != discre[i]){
        if( val > discre[i])
            left = i + 1;
        else right = i - 1;
        i = (left + right) / 2;
    }
    return i;
}
void discretization(){
    int L;
    scanf("%d%d",&N,&L);
    for(int i = 0,j = 0; i < N; i++, j++){
        scanf("%d%d",&ai[i],&bi[i]);
        discre[j] = ai[i];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX