-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathABHI.cpp
More file actions
45 lines (40 loc) · 716 Bytes
/
ABHI.cpp
File metadata and controls
45 lines (40 loc) · 716 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<iostream>
using namespace std;
int c[1000003];
void updateInterval(int node,int start,int endi,int l,int r)
{
if(start>endi||start>r||endi<l){
return;
}
if(start==endi)
{
c[start]++;
return;
}
int mid=(start+endi)/2;
updateInterval(node*2,start,mid,l,r);
updateInterval(node*2+1,mid+1,endi,l,r);
}
void updateRange(int node,int start,int end,int l,int r,int val)
{
if(lazy[node]!=0)
{
c[node]+=(en)
}
}
int main()
{
int n,m,w,a,b;
cin>>n>>m>>w;
for(int i=0;i<n;i++)
{
cin>>a>>b;
updateInterval(1,1,w,a+1,b+1);
}
for(int i=0;i<m;i++)
{
cin>>a;
cout<<c[a+1]<<endl;
}
return 0;
}