Invitation to CodeChef July Cook-Off 2020

They may seem similar but they are actually very different when you solve it!
For eg, in codechef’s problem, if(n>60) ans is “NO” because there will be repetitions in bits.
If you try to solve this problem using leetcode’s version of the problem you will receive TLE.

1 Like

How have you all thought about the logic of BOJACK to be 2*‘a’ + 2*‘b’ ???

lol it happens

1 Like

Mine was (d times ‘a’) + ‘b’ + (d times ‘a’)

1 Like

No.
If N > 60, then the answer will always be NO, and you break out of the loop after at most 61 iterations.

1 Like

That’s probably because of weak testcases! :confused:

1 Like

how did you think of such a logic??

Like I thought number of distinct sub-strings will be some Quad function. So, I tried to find some string patterns where number of palindromic sub-strings is also a Quad function. So subtracting them I’d get a linear function. So, in this way I can get answer for every d. Quad function may not have real roots but linear would have.
In case of my strings-
distinct sub-strings= n+(n+1)^2
palindromic sub-strings=(n+1)^2
where n= \frac{\lvert {s} \rvert }{2}.
So, equation becomes n+(n+1)^2-(n+1)^2=d.
That is n=d.

3 Likes

Amazing problems

Surprisingly, there were around 1K people in Div 1. :hushed:

1 Like

Really great problems!!! (I didn’t take part in the contest, but was solving all the time, just not submitting). Congratulations for the nice collection of problems!

Still, certain improvement can be sought in these two areas:

  • too weak test cases for some problems;
  • some problems were already present in the Internet, and people could simply google their solutions.

These two points are not great, and I hope CodeChef will put some efforts to improve them.

2 Likes

Agree, one more thing, please from now onwards include easy questions too from div 2 in div 1 , so that at least we can solve ( after solving 2 questions it gives some confidence to solve more ) some questions in div 1 , yes CC may calculate relative increment in rating more effectively. Also , be sure that the brute force (not even optimized) will not pass the TC’s , same weak test case are in May cook off.

@admin @rajarshi_basu @sjshohag

1 Like

Bro why for n>=70 or 60 the answer is NO ?

Here u can find out why it is so .

1 Like

Thanks bro.

In this cookoff, Div2 and Div1 problems were combined for people in Div1. The first two problems were in fact div2 problems. With that in mind, I only managed to solve 1 Div1 problem it seems :open_mouth:

2 Likes

There is no point of having divisions then.

4 Likes

Hi, Great to see you making Problemset on codechef :relaxed:, you came a long way.

Great approach

1 Like

can feel u bro…

1 Like