Editorials should be made simple

I have seen Codechef editorials to be very confusing and most new coders face the problems to understand the approach.
Why not make short and simple editorials explaining the approach NOT in a complicated way ?
More like Codeforces editorials.

6 Likes

I think codeforce editorial is not begginers friendly as compared to codechef.But one request is editorial should contain atleast one example and if necessary please include some visuals.

13 Likes

Codeforces editorials are easy to understand? That’s news to me.

9 Likes

Setter , tester solution should be easy and it should not contain things like (bits/stdc++.h) and stuff like typedef and they should make easy solution so that anyone can understand .

2 Likes

I agree even codeforces editorial are more cryptic then codechef.
Every editorial seems to target experts - which they maybe dont
need them because they already knew it. Purpose of the tutorial
should be it would make a beginners understand it well and
learn something from it so that they can adept from it.

3 Likes

look at this I have made a simple editorial of a medium-hard problem COOLCHEF using binary search.

:joy::joy::joy::joy:

…,…

1 Like

I think they should not keep long templates right ?
Is that what you mean to say ?

Can you post the link to the contest from which you said you found the probs of this JUNE challenge?


:joy::joy::joy:
At first it seems weird to everyone.
You can read about it here.

But I think a bit comment on tester,setter solutions can help a lot.

1 Like

Whenever i’m not able to solve a problem in a live contest i feel really bad and become sad. But i always take this as a silver lining. That is, if i’m not able solve a problem i’ll have to see the editorial later and i’ll learn new tricks. That seems cool to me.

If the level of editorial is within your reach, will you be able to get out from your comfort zone ? will you learn new tricks and things?

4 Likes

Can anybody help me find out the reason for TLE in this, I used the approach illustrated in the editorial. https://www.codechef.com/viewsolution/24861538 , the editorialist’s solution in same as your’s @l_returns , can you kindly help me with this?

XD :rofl::rofl: [20 char curse]

Isn’t this O(n) in worst case ?
int ct[c]={}

Wait… if i initialize an array with an empty bracket shouldn’t that by default initialize every element with zero in constant time?
Moreover if it does take O(N) time then why does sub-task 3 passes?

EDIT : Ok so i searched about it a bit, it turns out this is not a constant time operation (now
i feel like an idiot, that didn’t knew a thing this basic, been using this all the time.
Though initializing like this will not take worse time than memset or loop, its usually faster then those two.

I still don’t understand why does the 2nd ans 3rd subtask gives AC as the number of distinct elements ( = c in my program ) can be n/2 in worst case which makes this an q*n algo.

1 Like

Is it ?
I just declared the array outside and used memset and time taken reduced from
3.88s to 1.26s
Will try removing memset later.
I still thinks it’s memset which requires optimization.
Let me try.

It’s simple
“Weak test cases + strong optimizations”
XD

Yeah and you know who is author of that link ?
@aryanc403 himself :stuck_out_tongue:
He makes editorials in Russian using Google translate and then solve questions :joy:
I am not sure about this though but one thing he does for sure
he add’s it to “robot.txt” so that you can’t find it using Google :stuck_out_tongue:

1 Like

Wtf! :joy: :joy::joy::joy::joy::joy:

:joy::joy::joy::joy::joy:
OK so, what can i do to improve this? I am essentially using the same approach as the editorial, i replaced the array ct[] with a map but that increased the time instead.
Even though using map the complexity is Q√n (compared to Qn using ct[] array), so i guess that’s because of weak test cases.
Even though 1-3 subtask takes only 1.4sec or so last subtask times out.
Any help is appreciated.