Блог пользователя failure_forever

Автор failure_forever, история, 21 месяц назад, По-английски

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

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
21 месяц назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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

»
21 месяц назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

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.