Invitation to CodeChef September Long Challenge 2018 sponsored by ShareChat!

6

Hello CodeChef Community!

We’re excited to announce the September Long Challenge sponsored by ShareChat. Along with the opportunity to boost your ratings and win some cool laddus, there are some exciting full-time job opportunities with ShareChat for professionals across the globe. More details about the job opportunities can be found on the contest page.
solaimanope
I hope you will join your fellow programmers and enjoy the contest problems. Joining me on the problem setting panel are:

Contest Details:

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 performers in Global and Indian category will get CodeChef laddus, with which the winners can claim cool CodeChef goodies. Know more here: discuss.codechef.com/questions/51999/how-do-i-win-a-codechef-goodie. First to solve each problem individually: 100 laddus (For problems common to both Divisions, only one user will get laddus for that problem).
(For those who have not yet got their previous winning, please send an email to winners@codechef.com)

The editorials for $7$ of the problems are ready. Editorials were quite ahead of the schdule, but sadly there was an unexpected personal problem from $9$ to $14th$ september which messed the schdule up :(. The setter's solution for those $4$ editorials will be released so so yous dont have to wait for official editorials to explore the solutions.

Chef and Condition Zero

View Content

Hide Content

Assign some pattern or ordering to the $2-D$ array such that $P_i$ and $P_{i+1}$ are adjacent. Example, we can assign an ordering like-
$1,$ $2,3,...,$ $N$
$2N...N+3,N+2,N+1$

and so on. Convert this into a 1-D array and try to minimize the sum of maximum and minimum subbaray in it. Trying various orderings and various moves on $1-D$ array can give a good score.

Selina the Chef's falling on trees

View Content

Hide Content

From what I comprehended from setter's notes, it says that collisions are of no use. Use matrix exponentiation to compute contribution of each Selina individually. Details of how to construct the matrix can be seen from some of the AC solutions

Factoize

View Content

Hide Content

write phi(n) = $2^s * m$ where m is odd , let a be a random integer between [2 , n-1] , if gcd(a , n) is nonzero , we found a nontrivial factor , otherwise we have that $(a^m-1)(a^m+1)(a^2m+1)(a^4m+1)...(a^{2^{s-1}} + 1) = a^{\phi n} - 1$ which is a multiple of $n$ , but from among the factors on left , with probability $3/4$ , none of them divide $n$ , hence taking their gcd with $n$ , we will find a factor of n with high probability , then we recursively factor $x$ and $n/x$ where $x$ is the factor found (Note that we can use the same phi for factors as we dont really need phi but any multiple of exponent of Zn* which is a factor of phi).

Chef and Lost Story

View Content

Hide Content

The permutation we're looking for is in fact a perfect maching in the complete bipartite graphs represented by rows x columns.
Suppose some of these edges are black, while the others are white.
To check if we have a perfect matching with odd number of black edges we want the sum of even coefficients of
f(z) = det(M(z)) where $M_{i, j} = x_{i, j} * z$ (if {i, j} is black) or $= x_{i, j}$ (if {i, j} is white) to be non-zero.

We will start from the most significant bit and determine whether we can add a new bit to our configuration using the above mentioned algorithm.
The time complexity is $T(N) = T(N/2) + O(N * W) = O(N * W)$, where N is the maximum value and W is the time to compute the determinant.

I apologize for the delay, the required editorials will be put soon. Meanwhile, please enjoy the rest. :)

Each Selina only changes her direction (from bouncing to falling or vice versa) when she cannot keep moving in the current direction without leaving the tree or hitting another Selina, that is, when one of the following happens:

reaching a leaf when falling

reaching the root when bouncing

meeting another Selina that's moving in the opposite direction

Can someone please explain me the thord condition in STCFOTT problem, preferably with an example.

I am sorry to say but the example for this problem is very poor as it does not explain any of the above conditions. I think the setter or the tester should see to such problems. Disappointed with the codechef team. @admin@mgch

its okay @meooow. Assuming every possible case and submitting accordingly got me an AC. Still I think, if the probelm is not clear the setters should explain the problem with an example. The problem had left too much for us to understand.

Ironically name of problem CHEFZERO = Chef will give you Zero. xD.
Score of @mcfx1 0.000017 pts. His own soln with 0.642936pts fetches him zero.
We need a change in scoring fn. And rest of scores are of order 1e9.

After scoring fn has been updated.
My submission page shows score of 0.046pts $\approx$ 4.6 point on scoreboard. But it seems scoreboard is not updated. And when I visit Ranking Your Rank: 106 Your Score: 340.00002 is showing which correspond to 0.00002 pts.
Can you please check and remove conflicts.