Hello CodeForces Community!
We hope you all had a great time participating in November Long Challenge. Now it’s time to buckle up again and compete in November Cook-Off. So hurry up, note down the details and be there. Joining me on the problem setting panel are:
- Problem Setter and Admin: kingofnumbers (Hasan Jaddouh)
- Problem Tester: RetiredAmrMahmoud (Amr Mahmoud)
- Problem Editorialist:likecs (Bhuvnesh Jain)
- Russian Translator: CherryTree (Sergey Kulik)
- Mandarin Translator: huzecong (Hu Zecong)
- Vietnamese Translator: VNOI Team
I hope you will enjoy solving them. Please give your feedback on the problem set in the comments below, after the contest.
Contest Details:
Time: 19th November 2017 (2130 hrs) to 20th November 2017 (0000 hrs). (Indian Standard Time — +5:30 GMT) — Check your timezone.
Contest link: https://www.codechef.com/COOK88
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: https://www.codechef.com/laddu. (For those who have not yet got their previous winning, please send an email to [email protected])
Good Luck! Hope to see you participating!!
UPD: 90 minutes to start!
In Hasan and boring classes, I tried to do DP.
DP[i][k] := the number of palindromic string ignoring S[i+1..N-1-i) with k times modifications
This program can be optimized? I didn't come up with any ideas.
I came to the solution with FFT, but assume that NTT was intended.
Just count separately DP_equal, DP_different and DP_same and then multiply those.
FFT is not completely necessary, fixing the number of +1s which happen because of a pair of different characters and then using some partial sums of binomial coefficients is enough.
Interesting — does it still involve several DPs or can be done inplace by prefix sum?
No dp, just a bunch of binomial coefficients and powers.
Thanks, now I got it.
Thanks, helThazar and Kyoko-chan. I got your solution with the editorial. I missed that each pair in palindromic string is independent. I also want to know whether there is a general technique of optimization for above programs or not.