monu_dixit's blog

By monu_dixit, history, 11 months ago, In English

Python enthusiasts might face limitations accessing certain libraries like sortedcontainers during contests such as the recent Round 918 (Div 4) on Codeforces. While the problem F in that contest could be efficiently solved using SortedList from sortedcontainers, unfortunately, the platform might not support this module. Consequently, Python users had to opt for alternative approaches such as Binary Indexed Trees (BIT) or merge sort to tackle the problem. It's worth noting that while sortedcontainers could have been a valuable asset in solving the problem, its absence might have prompted participants to explore other techniques available within the contest environment.

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

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Helpful

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I switch to C++ for problems that require a sorted set. In the end, this limitation makes me learn.

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

very helpfu bro

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

any alternative for sortedcontainers here?

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Yeah. You are right. Why not create a template for sortedList and keep it with you?

Something like: https://codeforces.me/contest/1915/submission/239598054

I know it will make the code long, but it's just a template you can use. I hope that helps.

  • »
    »
    11 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes, there are many alternatives, will use from next time.