-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2007B.cpp
More file actions
53 lines (47 loc) · 848 Bytes
/
Copy path2007B.cpp
File metadata and controls
53 lines (47 loc) · 848 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
45
46
47
48
49
50
51
52
53
#include <bits/stdc++.h>
#define LL long long
#define FORL(i, n) for(int i = 0; i < n; ++i)
#define vi vector<int>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
//Functions
int main(){
IOS;
int t;
cin>>t;
while(t--){
int n,m;
cin>>n>>m;
vi p;
for(int i =0;i<n;i++){
int a;
cin>>a;
p.push_back(a);
}
int maxy = *max_element(p.begin(), p.end());
int arr[n];
FORL(i,n){
arr[i]=maxy;
}
FORL(i,m){
char c;
int l,r;
cin>>c>>l>>r;
FORL(j,n){
if(maxy>=l && maxy<=r){
if(c=='-'){
arr[j]--;
}
else{
arr[j]++;
}
}
}
}
FORL(i,n){
cout<<arr[i]<<" ";
}
cout<<endl;
}
return 0;
}