faild-in-2021's blog

By faild-in-2021, history, 21 month(s) ago, In English

I found this problem and i really can't solve it using java because of the weak DS in java, i want to ask if this is the limits of java or just me who didn't know how to solve it, if you have any idea please help,

https://cses.fi/problemset/task/2163

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
21 month(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

What was the time complexity of your solution? If it's nlogn (using order statistic tree) it should pass. Even an nlognlogn solution using binary search with segment tree might work.

»
21 month(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

Because of the relative speed/limit of the judge, there are some problems on CSES that are difficult to solve in Java just because Java is a little slower. For most problems the test cases are available on the submission site so you can try to download them test your program locally.