i am trying to solve this problem https://codeforces.net/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
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 166 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 160 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
i am trying to solve this problem https://codeforces.net/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
Название |
---|
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://codeforces.net/edu/course/2/lesson/4/2/practice/contest/273278/submission/252818945 thanks