GDSUB : Sept Codechef Long Challenge video editorial

Difficulty : Easy-Medium

GDSUB

suggestions are always welcome for making this channel better.
You guys are requested to support this channel by subscribing.
Thank you.
Happy Coding.

4 Likes

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

can you elaborate the ā€˜mainā€™ section of this code as im not able to understand the approach used by this person .

1 Like

Itā€™s difficult to understands someone elseā€™s code , it is much harder (and time consuming) if there are no comments , and brother since I am a little too busy , i canā€™t help you into this.
Try running dry run on that , that may help.

Mine should be more comprehensible:

2 Likes

Hi @ssjgz, congratulation on reaching 4*! Please, release the Editorials of LPAD and FUZZYLIN as well.

2 Likes

Thanks - looks like Iā€™ll get my a$$ kicked next Long Challenge as Iā€™ll be in Div 1 XD

Iā€™ll see if I can get FUZZYLIN and LAPD done later today, but no promises. LAPD in particular Iā€™m not very motivated about, as my code for it is so awful :confused:

3 Likes

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

Can someone explain whatā€™s wrong with my approach?
I used the power sum symmetric polynomial recurrence.

I have implemented exactly what you have described in the video (Nice Video).
But out of 8, 2 test cases are right this exact thing happened with at the time of contest also.

Please help me out.
https://www.codechef.com/viewsolution/26621190

most probably because you are not applying mod operation with 10^9 + 7.

1 Like

Hmmm ā€¦ Iā€™m not sure. It passes 10ā€™000 random, small-ish tests, but seems to have trouble with large-ish ones - for example, this one (I get the answer 57120030 for it - hopefully someone else can verify :))

power probably should be using lls instead of ints, but fixing this in your code still gives me the wrong answer.

Congratulations on reaching 4 stars! Iā€™m sure that itā€™s just a matter of time till you reach 7 stars. Good job!

1 Like

Thanks, but based on this long challenge (where I couldnā€™t figure out DOOFST no matter how hard I tried!) I think Iā€™ll be lucky to reach 5* XD

Speaking of which: I hope the DOOFST Editorial comes out soon - the suspense is killing me! Doubtless Iā€™ll kick myself when I see it!

PS - great CHEFK1 Editorial + code! :slight_smile:

2 Likes

Thanks! Youā€™re editorials are really good too! Before the contest ended, I thought that my code (I have made it look just like one of your heavily documented codes) for LAPD was short, sweet and pretty fast. But then, I looked at your code. How did you come up with those crazy optimizations?! Youā€™re frikkinā€™ amazing!

1 Like

Thanks, but my LAPD one is a real mess (loads of bodges and hacks everywhere), and only a teeny bit faster than yours XD

1 Like

can somebody explain whatsā€™s wrong with my code. I used dp

Solution link here

Yours seems to fail on the same testcase I posted here.

Oops I forgot that!!

Can you link the video please

happens sometimes , and I feel its completely normal

Same here buddy! Even i tried hard to solve DOOFST but couldnā€™t :sob: Letā€™s wait for editorial

1 Like