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

Автор Shameek, 4 года назад, По-английски

link to question — https://www.codechef.com/problems/CHEFINV

MY APPROACH -

  1. using a mergesort tree

  2. find swaps decreased and increased for A[L] due to L-R

  3. find swaps decreased and increased for A[R] due to L-R

  4. calculate answer

complexity — Mlog^n?

my code — https://ideone.com/tgs2nU

i also tried testing my code against one of the AC codes still couldnt find my mistake. any help would be appreciated!

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

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

I think in this kind of blog, problem link should be available. And most importantly your code is not given as link. I am green only and I do not know anything about mergesort tree, so I really won't understand you approach. But those who know and would be kind enough to help you will face problem. They can also lose interest seeing such an unorganized blog where they have to copy and paste the link of your code.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    i tried the approach you said in earlier questions and still got > 10 downvtes and no answers...**i ultimately delete the entry** and get answers to my questions 1 in 20 times..

    in fact in an earlier blog i received the exact opposite review i.e. post the question and not the link

    also, its a codechef question as i said and if you google the title the first link will be the question

    thanks a lot though!