I tried many test cases ,I am passing all of them But it is failing at test case 5 on codeforces. Since test case are quite large ,I am unable to figure out my error.Please forgive me if my question is not good. 55748387(My submission)
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3741 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3489 |
7 | Radewoosh | 3483 |
8 | Kevin114514 | 3442 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
2 | atcoder_official | 162 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | nor | 150 |
I tried many test cases ,I am passing all of them But it is failing at test case 5 on codeforces. Since test case are quite large ,I am unable to figure out my error.Please forgive me if my question is not good. 55748387(My submission)
Name |
---|
Change removelazy(node1, l, r) to removelazy(node1, start, end1)
Still getting wrong ,should i check also if the node is lazy or not while answering the query? Because i am not checking
You need to use removelazy in your query function
I added the removelazy in query part
I think there are many other issues in the implementation. I suggest you to check your implementation once again.
https://codeforces.net/contest/52/submission/54744859 take a look at my submission
Please can you tell me where I am doing the mistake?
First of all you are consider 0 base indexing in your build() function so your left child is (node1 << 1) + 1 and right child is (node1 << 1) + 2 and your query() function is
node query(int node1, int l, int r, int start, int end1) {
}
You do not consider if(tree[node1].lazy != 0) case in your query function