# How did your cook-off go?

Well the second question bugged me a lot i thought of dp and stuff but brute force worked wasted a lot of time there. The third question was completely implementation based but got wrecked by SIGSEV found the error in the last minute!

My rank is 580. Will my rating increase? ( Not a big deal, but still curious lol )

1 Like

Great! I got rank 11, which is one away from winning laddus.

17 Likes

Congrats!
Will be there soon! How did you solve the third question matrix oneâ€¦ share your code thanks

It was non-scorable for them

pretty quickly figured out CHEFSHIP by using Rabin-Karp hashing

got stuck in figuring out the formula for CROADS, couldnâ€™t get it

pretty bad ranking overall, but I hadnâ€™t competed since > 6 months, so always happy to be back on track

Omg

Mine went well. Got a rank of 193, solving 3. I donâ€™t know but I did the third and fourth, and missed the second one, XD.

yeah i too couldnâ€™t think of 2nd or get corner case in 4th but implemented 3rd it was implementation based. here is my code
Impressing Chefina

For you @aryan12 :

Even I did like you and even got TLE , in the last 10 mins i just tried it and got AC !

CodeChef: Practical coding for everyone . Missed \n in contest :-(. Got right after the contest ended

https://www.codechef.com/viewsolution/33312940

My code. If it is unreadable, I am sorry for that.

I donâ€™t have code, but my intuition:

Each row of the matrix must be a palindrome. So if M is even, every element must have an even number of occurrences. Otherwise, exactly at most N elements must have an odd number of occurrences, the rest even. Constructing it is just placing the even/odd elements appropriately.

Lol, I know the formula. But it will still tle. It is not that much dependent on that.

The formula XD

n / 2 - 1, where n is the length of the substring.

I thought only the first column and last column elements matter?

I would like to correct you. Not exactly N elements must have odd appearances. It is <= N, because you can take 2 even occurring elements also for the middle element.

1 Like

Doesnâ€™t it have to be more than that? The first elements that Chef and Chefina write down, respectively, are A_{1, 1} and A_{1, M}. The second elements are A_{1, 2} and A_{1, M - 1}, and so on. So each A_{i, j} must be equal to A_{i, M - j + 1}.

Good for you mate

How would you arrange this?

``````3 3
1 2 3
4 5 6
6 6 6
``````

if you use it then you would have got rid of the tle

It was good. Had participated in codeforces round just 25 minutes before the Cook Off and that made my brain to hang up but still managed to solve 2 questions.

1 Like