hihoCoder太阁最新面经算法竞赛7 register

Ended

Participants:100

Verdict:Wrong Answer
Score:0 / 100
Submitted:2016-07-09 18:46:38

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<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const  int maxn=100009;
const long long MAX=1e9+7;
long long sum[maxn*4],mar[maxn*4];
void pushup(int o )
{
    sum[o]=sum[o<<1]+sum[o<<1|1];
}
void pushdown(int o,int m)
{
    if(mar[o])
    {
        mar[o<<1]+=mar[o];
        mar[o<<1|1]+=mar[o];
        sum[o<<1]+=mar[o]*(m-(m>>1));
        sum[o<<1|1]+=mar[o]*(m>>1);
        mar[o]=0;
    }
}
void build(int l,int r,int o)
{
    mar[o]=0;
    if(l==r)
    {
        sum[o]=0;
        return;
    }
    int m=(l+r)>>1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX