hiho week 19 register

Ended

Participants:317

Verdict:Accepted
Score:100 / 100
Submitted:2014-11-09 15:35:25

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 <cstring>
#include <cstdio>
#include <algorithm>
#define lowbit(x) (x)&(-x)
#define MID (l+r)>>1;
#define ls o<<1
#define rs (o<<1)|1
#define maxn 1000005
using namespace std;
struct node{
    int l,r,weight;
}tree[maxn<<2];
void build(int l,int r,int o=1)
{
    tree[o].l=l,tree[o].r=r;
    if(l==r){
        scanf("%d",&tree[o].weight);
        return;
    }
    int mid = MID;
    build(l,mid,ls);
    build(mid+1,r,rs);
    tree[o].weight = min(tree[ls].weight,tree[rs].weight);
}
void update(int x,int alt,int o=1)
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX