hiho week 246 register

Ended

Participants:141

Verdict:Accepted
Score:100 / 100
Submitted:2019-03-19 21:17:58

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 <bits/stdc++.h>
using namespace std;
const int N = 20000 + 5;
struct Node
{
    int l,r;
    int i;
    int modui;
}q[N];
bool cmp(Node x, Node y)
{
    if( x.modui == y.modui)
        return x.r < y.r;
    return x.l < y.l;
}
int data[N];
int A[2][N];
long long ans[N];
int lowbit(int x)
{
    return x & (-x);
}
void add(int i, int pos, int change)
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX