i am trying to solve this problem https://mirror.codeforces.com/edu/course/2/lesson/4/2/practice/contest/273278/problem/B this is my code https://ideone.com/T1U9z5 i got WA on test 16 but i cannot spot the mistake i made
# | 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 | 3443 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
2 | atcoder_official | 163 |
4 | maomao90 | 162 |
5 | adamant | 158 |
5 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | djm03178 | 154 |
8 | TheScrasse | 154 |
10 | Dominater069 | 153 |
i am trying to solve this problem https://mirror.codeforces.com/edu/course/2/lesson/4/2/practice/contest/273278/problem/B this is my code https://ideone.com/T1U9z5 i got WA on test 16 but i cannot spot the mistake i made
Name |
---|
Damn, you are green and solving segment tree...
If you know russian you can watch pashka's tutorial on that problem, and find mistake by yourself
first i don't although no need bcs tutorial is in english and secondly it will be no help he uses recursive segment tree while i use iterative one.
Iterative segment tree?
Wow that pretty interesting, my bad
anyways if you will help me do it else stop wasting my time
I wanted to, but I'm doing recursive and you're doing iterative
no need to be that toxic, he is just asking it, you are responding like you are cm or expert, but you cannot solve basic questions.
Finally, thank you
The problem is on line 89. When you go in the right subtree, you need to subtract the number of $$$1$$$ in the left subtree.
Something like this:
i tried this but did not work upd:nvm it worked thanks a lot i did not think of this
btw can you please help me on another task the C here is my code https://mirror.codeforces.com/edu/course/2/lesson/4/2/practice/contest/273278/submission/252818945 thanks