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

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

We invite you to participate in CodeChef’s Starters113, this Wednesday, 20th December, rated for All.

Time: 8:00 PM — 10:30 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 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!

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

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

Omg satyam343 round,all problems of all divs!

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

As someone who has seen the problems, i regret missing the chance to participate

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

rejected a party invitation to give this contest , hopefully it goes well

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

Friendly reminder: The contest starts in less than 60 minutes. I hope you like the problems.

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

unable to understand this counting in fun problem statement. It's too complicated.

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

    You can use the comment section on Codechef to ask questions. Also 8 participants in Div 1 have ACed the problem. So, probably, the statement isn't that bad.

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

Loved the problemset, SCORESUM7 is such a cute problem.

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

Scores and ranks (for me at least) are not up-to-date until now ...

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

Counting is Fun was amazing!

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

I hope you liked the problems! I would love to hear your feedback.

By the way, do check out the intended solution for COUNTIFUN7. It is one of my favourite problems that I have authored.

Once you establish a nice bijection, the solution is just 4-5 lines of code.

Code
  • »
    »
    5 месяцев назад, # ^ |
      Проголосовать: нравится -27 Проголосовать: не нравится

    Yes, a math problem is the best CP problems you've authored :clown:

  • »
    »
    5 месяцев назад, # ^ |
    Rev. 6   Проголосовать: нравится +21 Проголосовать: не нравится

    Damn, nice solution. I solved it in a quite complicated way. This was my solution:

    Let us fix the value of prefix minimum, call it $$$x$$$. Thus $$$1$$$, $$$2$$$,..., $$$x-1$$$ all occur after $$$x$$$. If the nearest smaller element occuring after $$$x$$$ is $$$y$$$ positions ahead, then contribution to answer is $$${y+k-1 \choose k}$$$. So if we denote by $$$ans(x,l)$$$ as the sum of $$${(t_2-1)+(k-1) \choose k}$$$ over all $$$1=t_1<t_2<t_3<...<t_x<t_{x+1}=l+1$$$ ($$$t_i$$$ are the relative positions of elements $$$<x$$$ wrt $$$x$$$) , Then contribution to the final answer for $$$x<V$$$ is $$$\sum_{l=1}^{n-1} ans(x,l)(x-1)!(n-1-x)!$$$ and for $$$x=V$$$ is $$$ans(V,n)(V-1)!(n-V)!$$$.

    To determine $$$ans(x,l)$$$, we observe that $$$ans(x,l)=ans(x,l-1)+ans(x-1,l-1)$$$ for $$$x>1$$$ and $$$ans(1,l)={l+k-1 \choose k}$$$. So if we represent a generating function $$$G_x = \sum ans(x,l)z^l$$$, then $$$G_x = z(G_x+G_{x-1})\Rightarrow G_x=\frac{zG_{x-1}}{1-z}$$$ and $$$G_1$$$ is $$$z(1-z)^{-k-1}$$$. Thus $$$G_x=z^{x}(1-z)^{-k-x}\Rightarrow ans(x,l)={l+k-1 \choose l-x}={l+k-1\choose k+x-1}$$$

    Plugging this in summation gives a telescopic sum, thus contribution for each $$$x$$$ can be found in $$$O(1)$$$.

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

What is mistake in this https://www.codechef.com/viewsolution/1036038527 can any one give any counter test

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

Can anybody give me a counter testcase for MAKE ALL EQUAL problem, here is the code https://www.codechef.com/viewsolution/1036034543

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

What is the solution to Make All Equal?

Consider the case $$$N = 8, M = 2$$$ and $$$A = [3, 4, 5, 8, 8, 8, 8, 8]$$$. How does the official solution make the array all equal in 6 steps?

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

i think your rating is bugged, it shows -279 in last edu round

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

I loved this problemset and liked MAKEALLEQUAL and SCORESUM7 problems

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

Maximise the Min. problem can be solved without dp too , using set.

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

I was wondering what would be the solution to the MAKE ALL EQUAL problem , if we allowed exactly m operations?

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

    Find the smallest $$$x$$$ which is greater than or equal to maximum element of initial $$$a$$$ and $$$(x \cdot n - \sum_{i=1}^{n}a_i) \mod m=0$$$. Finding $$$x$$$ is not that hard.

    Hint

    It might be the case that such $$$x$$$ doesn't exist, in which case it is impossible to make all the elements same.

    Now it might be the case that $$$\frac{(x \cdot n - \sum_{i=1}^{n}a_i)}{m} > x - a_{min}$$$. So you need to do some algebraic manipulations to find the optimal $$$x$$$.

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

Alternate method to Minimise max , using prefix sums and sets.

AC Code