RahulHarpal's blog

By RahulHarpal, history, 4 months ago, In English

Hacking has been one of the most crucial features of any contest. With its ability to completely change the outcomes of the rounds.

But the one thing the standings page of any CodeForces round lacks is the standings page for hackers. They contribute essential test cases to the problems, making the problems more robust.

I introduce to the community a new extension, CF TopHacker (Chrome WebStore Link), made by me to add this feature to the standings page. The "Hacks Standings" button integrates with the default buttons seamlessly.

This extension enables you to see the live hacks leaderboard during the open hacking phase and also after it ends! This makes it easier for everyone to see which problems have weak test cases in case there are too many hacks!

See the screenshots and demo video below:

Screenshot 1:

Screenshot 2:

Demo Video

GitHub Repository

This extension is open source, free forever and open to contributions by the community. Any feedback for this extension is appreciated. I am also open to new ideas/features. Do write how you feel about this extension in the discussion below! Thank You!

It would be cool to hear what top hackers like djm03178 and qmk have to say about this extension.

UPD 1: Here are the open issues on the github repository, feel free to generate a pull request to fix these! These issues were mentioned by the users in the discussion below.

UPD 2: The bug related to the extension not working in the Russian Language is fixed! All thanks to MANAV_2005 for the fix and okwedook for pointing out the issue.

UPD 3: New Version (1.5.0) now available on Chrome Web Store! What's new:

  • Added top-level cache to reduce server loads. Credits for the issue goes to qmk and the fix is contributed by Karim_Abdelaziz

  • You can now double-click on any hack to show a hacks window which shows the hacks for each problem by that user. Credits: Karim_Abdelaziz

  • Highlighting current users & Support for tourist rank. Credits: Piyush

  • Added pagination support (only 100 entries per page displayed). Credits: Shashank

  • Updated documentation for contributing guides, README files, and issue templates. Credits: Ragini

  • If you have already installed this extension, it would have been updated to latest version automatically.

CF TopHacker: Version 1.5.0

Full text and comments »

  • Vote: I like it
  • +122
  • Vote: I do not like it

By RahulHarpal, history, 10 months ago, In English

Hello, I have enrolled in my college's "Design and Analysis of Algorithms" course. Recently we were studying Greedy algorithms and proving their correctness. I have a doubt about the correctness proof of Prim's Algorithm. How do we prove that it does not form a cycle during its execution? In the following snippet from our lecture slides (from Page No. 58, the MST part starts), it says:

"No cycles ever get created in T. Why? Consider any iteration with current sets X and T. Suppose e gets added.

Key point: e is the first edge crossing (X, V-X) that gets added to T -> its addition can't create a cycle in T (by Lonely Cut Corollary). QED!"

For clarification:

  1. T is the set of edges that Prim's algorithm has included to be a part of MST at any point in time during its execution.

  2. V is the set of all vertices of the input graph.

  3. X is the set of vertices that are already included in the output tree.

  4. V-X is the set of vertices which are not yet been included int the output tree.

Definition of a Cut of a graph: https://postimg.cc/SJsMFKJ7

Definition of Empty Cut Lemma: https://postimg.cc/JsQdQ8bV

Definition of Double crossing Lemma and Lonely Cut Corollary: https://postimg.cc/5QFR5Fmn

Algorithm/Pseudocode stated in lecture slides: https://postimg.cc/nsBrWdhJ

slide

How are we using the Lonely cut corollary in the part highlighted with yellow in the above image to prove that cycles won't form in the output spanning tree?

I have searched many resources on the internet for my doubts (including CodeForces blogs), but I am not able to find a reasonable explanation for the above question. Please help.

Thank you.

Full text and comments »

  • Vote: I like it
  • -3
  • Vote: I do not like it