I want to find out time complexity and space complexity of this code.
https://cses.fi/paste/4c432ea7de710eac40593c/
I was trying to solve this task but I was getting TLE.
# | User | Rating |
---|---|---|
No items |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 171 |
2 | awoo | 163 |
2 | adamant | 163 |
4 | maroonrk | 152 |
5 | nor | 151 |
5 | -is-this-fft- | 151 |
7 | TheScrasse | 147 |
7 | atcoder_official | 147 |
9 | Petr | 145 |
10 | pajenegod | 144 |
I want to find out time complexity and space complexity of this code.
https://cses.fi/paste/4c432ea7de710eac40593c/
I was trying to solve this task but I was getting TLE.
Name |
---|
Auto comment: topic has been updated by .dragonman164 (previous revision, new revision, compare).
Wow, you really have no clue. I guess you just think that segment tree is magic.
Time complexity is $$$O(n \log^2 n + qn \log n)$$$, space complexity is $$$O(n \log n + qn)$$$ ($$$qn$$$ part might not be true, I'm not sure how is it measured).
Lol!!! I got it. Thanks!!!!