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

Автор smartnj, 7 лет назад, По-английски

Greetings to you all!

Note that CodeChef’s April Cook-Off is on a Monday this month instead of the usual Sunday. Also, this Cook-Off will use new cloud-based checkers, about which you can read here.

I take the opportunity to invite you to this 2.5-hour short contest. You’ll have 5 problems to solve and the best performers will be treated with Laddus redeemable for cool CodeChef goodies!

We will also be hosting a live problem discussion session on Tuesday (21st) from 5pm to 7pm IST on Zoom and Youtube Live, where our panelists, teja349 (Teja Vardhan Reddy) and RestingRajarshi (Rajarshi Basu) will discuss the Cook-Off problems. If you’re interested only in the hardest couple of problems, join in at 6pm. You can book your spot here.

The problem statements of the contest will be available in English, Hindi, Bengali, Russian, Mandarin, and Vietnamese.

The problem setting panel :

  • Setters: FastestFinger (Ayush Ranjan), smartnj (Naman Jain)
  • Tester: raja1999 (Raja Vardhan Reddy)
  • Editorialist: RestingRajarshi (Rajarshi Basu)
  • Statement Verifier: Xellos (Jakub Safin)
  • Admin: teja349 (Teja Vardhan Reddy)
  • Russian Translator: Mediocrity (Fedor Korobeinikov)
  • Vietnamese Translator: Team VNOI
  • Bengali Translator: solaimanope (Mohammad Solaiman)
  • Hindi Translator: Akash Shrivastava
  • Mandarin Translator: Qingchuan Zhang

Contest Details:

  • Time: 20th April 2020 (21:30 hrs) to 21st April (00:00hrs). (Indian Standard Time: +5:30 GMT) — Check your timezone.
  • Contest link: http://www.codechef.com/COOK117
  • 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 10 Indian and top 10 Global participants will receive CodeChef laddus, with which the winners can claim cool CodeChef goodies. Know more here.

Good luck and have fun!

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

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +46 Проголосовать: не нравится

Reminder: Contest starts in 10 hours

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +15 Проголосовать: не нравится

Hope that codechef does not crash like last lunchtime.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

Thanks for a nice problem set. The difficulty gradient in Div2 was a bit skewed.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +134 Проголосовать: не нравится

Wonderful improvement in servers !! The submission result was ready in less than a minute..Codechef does deserve an appreciation for this quick improvement after what happened in last lunchtime.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

In tower counting problem do we needed to solve by brute force and calculating the slope ?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

How to solve D? (The Gifting Problem)

  • »
    »
    7 лет назад, скрыть # ^ |
    ← Rev. 2  
    Проголосовать: нравится +62 Проголосовать: не нравится

    First notice that $$$G(i,j)=i\oplus j$$$ (xor of $$$i$$$ and $$$j$$$). So if the initial array was $$$a$$$ then after a year the new array $$$b$$$ will satisfy $$$b_i = \displaystyle\sum_{j=0}^{N-1} \left(i\oplus j\right)a_j$$$. A naive way to obtain $$$b$$$ would be to add $$$ia_j$$$ to $$$b_{i\oplus j}$$$ for each $$$0\leq i,j \lt N$$$. This is readily an instance of xor convolution: the process is the same as multiplying two polynomials $$$P(x)=\displaystyle\sum_{i=0}^{N-1} ix^i$$$ and $$$Q(x)=\displaystyle\sum_{i=0}^{N-1} a_i x^i$$$ with $$$x^i \cdot x^j$$$ defined to be $$$x^{i\oplus j}$$$. So the final array is simply the coefficients of $$$P(x)^KQ(x)$$$. You can efficiently compute the power and product applying fast Walsh-Hadamard transform.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

How to solve MINOPS?

  • »
    »
    7 лет назад, скрыть # ^ |
    ← Rev. 3  
    Проголосовать: нравится +1 Проголосовать: не нравится

    let x be the leftmost position such that s[x]!=r[x] , let y be the right most position such that s[y]!=r[y]. Then we need to solve for sub array [x,y] . Now answer cannot be greater than y-x+1 . Now create an array A which stores length of all continuous segments which are same in both arrays[x,y].sort the array in descending order. now the answer is ans = min(ans,2*(ans-A[0]),3*(ans-A[0]-A[1]),4*(ans-A[0]-A[1]-A[2])....,) .Because when we skip a segment which is same in both array , we increase number of operations by 1 . Also if we are skipping we will always skip the largest one. complexity O(n).

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +31 Проголосовать: не нравится

All the editorials can be found here.

And join us for the live stream tomorrow, where the panelists discuss the problems!