hiho week 20 register

Ended

Participants:214

Verdict:Accepted
Score:100 / 100
Submitted:2014-11-17 22:34:51

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 <queue>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
#define LL long long
#define inf 0x3f3f3f3f
#define mnx 100020
#define mxe 2020
#define eps 1e-5
#define ls (i << 1)
#define rs (ls | 1)
#define md ((ll + rr) >> 1)
int sum[mnx << 2], add[mnx << 2];
int a[mnx];
int n;
void build(int ll, int rr, int i) {
    add[i] = -1;
    if(ll == rr) {
        sum[i] = a[ll];
        return;
    }
    build(ll, md, ls), build(md + 1, rr, rs);
    sum[i] = sum[ls] + sum[rs];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX