A number of contests(internal and external) are being conducted on Codechef, and after the contest ,
The questions are expected to be immediately added to the practice section
The solutions made during the contest need to be made PUBLIC
But of late, this isn’t happening properly. The September Lunchtime submissions were not visible for almost 2 days, and questions were added after quite a bit of a delay.
The LOC contests, which have been churning out good quality problems for some time now, neither have proper editorials nor are the questions being added to practice soon enough.
Such delays are spoiling the urge to upsolve and learn, so I request the team to follow the protocol a little more meticulously.
Suggestion : If it is possible for the team to automate the whole process, it would be amazing! The delays would be wiped out, much to our delight.
the external contest hosts have an option to specify the ‘cooldown’ time after which the questions are sent to the practice section. So it’s upon the hosts to decide when to move them to the practice section.
neither have proper editorials nor are the questions being added to practice soon enough.
On a lighter note, you wouldnt want that once you know that most of those Q are either copy of standard Q or a copy of some already existing Q
(I am forgetting the month, it had some Q on “Mafia and cities” which was a complete ripoff of a Q from an old long contest XD. Remember this example most of the Q on that LoC were copied from codechef itself)
Well, what can we do about it But editorials of some sort would be much appreciated Or if the “problem setter” redirects us to the original problem’s editorial, even that would do xD
I agree that some sort of editorials will be appreciated. Quality ones, that is . If theres some specific Q bugging you, you can request an editorial. I am sure one of us would love to write it (perhaps me if I solved he problem XD)
Initially, let the Answer=N , the maximum possible value. Now, we know that if someone is related to some other guy, we can claim that “Only 1 of the 2 need to be affected initially” as the other one will automatically get affected later.
So, what I propose is, make the graph. Do DFS( mind it, its a possible disconnected graph!) and reduce the answer as you find you can reach/infect more and more people by given relation. Didnt try it, but it should work, and that too in roughly ~O(N) time.
Assuming you know about graphs, the question simply boils down to finding the number of connected components in the given undirected graph. @vijju123 has covered that up.
Alternatively, one could solve the question using Disjoint set Union. Pretty straight forward implementation of the DSU data structure.