hiho week 21 register

Ended

Participants:248

Verdict:Accepted
Score:100 / 100
Submitted:2014-11-24 15:08:14

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 "stdio.h"
#include "math.h"
#include "stdlib.h"
#include "memory.h"
#define NUM 100010
int N=0;
typedef struct Node
{
    int l;
    int r;
    int val;
    int flag;
}Node;
Node tree[4*NUM]={0, 0, 0, 0};
long long s[2*NUM]={0};
int ind[2*NUM]={0};
int sq[2*NUM]={0};
int res=0;
int Partition(int low, int high)    //
{                                           //
    // 
    int p=rand()%(high-low+1)+low;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX