JeevanJyot's blog

By JeevanJyot, 14 months ago, In English

We invite you to participate in CodeChef’s Starters 77, this Wednesday, 15th February, rated till 5-stars Coders (ie. for users with rating $$$< 2200$$$).

Time: 8 PM — 11:00 PM IST

Joining us on the problem-setting panel are:

Written editorials will be available for all on discuss.codechef.com. Pro users can find the editorials directly on the problem pages after the contest.

The video editorials of the problems will be available for all users for 1 day as soon as the contest ends, after which they will be available only to Pro users.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Hope to see you participating. Good Luck!

  • Vote: I like it
  • +30
  • Vote: I do not like it

»
14 months ago, # |
  Vote: I like it +28 Vote: I do not like it

you guys need to chill out with the silly adhoc problems

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

Any hints on SORTXOR ?

I knew how to reverse array in 3n/2 steps, but to sort I didn't end up on any conclusion, is it related to cycles ?

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

    yes

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

      I know how to find the cycles in a permutation but how in an array with duplicate elements?

      • »
        »
        »
        »
        14 months ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        try to get positions what will be the new position of element in this position

        It is easy with permutaions is because new positoin of i is i in sorted permutation

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

How to solve KFOREST?

  • »
    »
    14 months ago, # ^ |
    Rev. 3   Vote: I like it +3 Vote: I do not like it
    Solution
»
14 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Is it not possible to solve sort a string using some kind of custom sort function?

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

    We don't always have to put the smaller value at lower index.
    look at the string, str = "cab"
    output from a custom sort function will be "cab", but the lexicographically smaller value that can be obtained is "bca"