Alex_2oo8's blog

By Alex_2oo8, history, 5 years ago, In English

Greetings Codeforces Community!

Brace yourself because Long Challenge contest of the month is HERE! Expect nothing short of a thoroughly thrilling 10-day code-cation; featuring exciting problems, amazing competition and lastly, a chance to level up your rating.

Moreover, the Long Challenge is particularly crafted to help you hone your coding skills, while competing amongst the best of the best. Top 20 participants from each college/university will win scholarships for CodeChef Certification exam. Visit the contest page to know more.

In addition, if you have some original and engaging problem ideas, and you’re interested in them being used in the CodeChef's contests, you can share them with our admins here: https://www.codechef.com/problemsetting/new-ideas

Do join your fellow programmers and actively participate in this exciting contest. Joining me on the problem setting panel are:

Contest Details:

  • Start Date & Time: 2nd August 2019 (1500 hrs) to 12th August 2019 (1500 hrs). (Indian Standard Time — +5:30 GMT) — Check your timezone.
  • Contest link: https://bit.ly/2LFPyxM
  • Registration: You just need to have a CodeChef handle to participate. For all those who are interested and do not have a CodeChef handle, are requested to register in order to participate.
  • Prizes: Top 20 performers in Indian category and top 10 performers in Global category will get CodeChef laddus, with which the winners can claim cool CodeChef goodies. First to solve each problem except challenge — 100 laddus. Know more here: https://goodies.codechef.com/

(For those who have not yet got their previous winning, please send an email to [email protected])

Good Luck! Hope to see you participating! Happy Programming!

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

| Write comment?
»
5 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Rating prediction for div1 is here and for div2 is here.

»
5 years ago, # |
  Vote: I like it +4 Vote: I do not like it

How to solve CHGORAM ?

  • »
    »
    5 years ago, # ^ |
    Rev. 3   Vote: I like it +3 Vote: I do not like it

    only 3 possible trends are possible Peak trend i.e. p1>max(p0,p2), Valley trend p1<min(p0,p2) or line trend(increasing/decreasing) where p0<p1<p2 or p0>p1>p2. All three of them can be solved separately with DP on trees.

    • »
      »
      »
      5 years ago, # ^ |
      Rev. 2   Vote: I like it +1 Vote: I do not like it

      Alright. I got this part, but how exactly we are calculating no. of possible p0, p1 candidates for a fixed p1 ? . I means if I had to count such triplets in an array, I'd have gone with segment tree/merge sort tree or similar data structures to count p0, p1 for each possible p1. But here it is tree.

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it +4 Vote: I do not like it

        You basically have to calculate contribution for each child(ci) of node vi the number of values less than vi and number of values greater than vi in subtree of ci. and then use combinatorial approach for calculation for each specific trend by iterating over all children of node vi.

»
5 years ago, # |
  Vote: I like it +9 Vote: I do not like it

How to solve CSTREE??

»
5 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Is there is some better way to solve "Tree Sequence".
I try Heavy-Light Decomposition + maintaining four segment tree for each type of query + some combinatorics,
But it's implementation become too hard and error prone.