Post Contest Protocol - Request to follow it strictly

A number of contests(internal and external) are being conducted on Codechef, and after the contest ,

  1. The questions are expected to be immediately added to the practice section
  2. 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.

1 Like
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)

Need editorial for local contests that are held on codechef like Codenesia: Contest Page | CodeChef
Please help and provide editorial for the 2nd question (Disease) CodeChef: Practical coding for everyone

@orion

Think about it in terms of graph.

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.

@orion

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.

1 Like

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.

I have hosted 2 contests on Codechef, and on both occasions, I had to mail the contest admin to add questions to practice section.

I didn’t have to send a mail explicitly. I do agree about the LOC editorial thing though, @admin please do publish the LOC editorials :smiley:

Well, what can we do about it :smiley: But editorials of some sort would be much appreciated :stuck_out_tongue: 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 :slight_smile: . 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)

You just need to find the minimum number of people initially infected so that after spread, whole population is infected…

Try to put this in graph terminology

Find the minimum number of vertices so that all the vertices of graph are connected to these vertices, directly or indirectly…

The solution is to find the number of connected components in a graph…

Example: (0-based indexing)

4 2
0 1
1 2

You see, if we select any one of 0,1 or 2, the other two will be automatically infected…

But vertex 3 has to be selected…

Therefore ans = Number of connected components = 2 :slight_smile:

DSU basd solution : Link