failure_forever's blog

By failure_forever, history, 22 months ago, In English

Hello folks!!

I want to understand how to approach the problems where we have to do some sort of operations on array. For example swap some elements such that array becomes increasing . Something like this . I find it difficult that how to pick the operations and perform them optimally. I would be highly obliged for valuable tips and suggestions .

Regards

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
22 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Mostly these type of problem have some observation which can be caught by writing some test cases and concluding some key takeaways and some reasoning etc and also using pen and paper while solving this kind of questions helps

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

What you're asking is unbelievably broad, and one can't possibly help you with that. CP isn't like school where you memorize how to approach each type of problem and just copy that approach on a test. You need to think on a problem by problem basis.

For the specific problem you're talking about, there is an explanation of it on the Competitive Programmer Handbook inversion section.