Wouldn't be nice to have, once in a while, debugging contests on codeforces?
Rules: like a normal contest (old problems can be reused), but you are given a code with some bugs and you have to correct it (you can only submit solutions whose edit distance from the starting code is $$$\leq k$$$).
That's a unique idea ,but I guess most people don't like debugging.
This might be an interesting format.
In my opinion, limiting edit distance from source code is definitely a bad rule. Because sometimes debugging should lead to considerably large amount of changes that will keep code consistent instead of adding a small but very tricky hacks that will keep you code running fine, but it will cause problems with every next change you want to make. You can say that competitive programming is not great place for best practices, refactoring and clean code overall, but it is definitely a place for some practices. And these practices vary significantly from coder to coder, everyone has his own definition of consistency and chooses practices, templates and patterns that suits him better. So in some situations it might turn out that is it simplier to reimplement something from scratch rather than fix something and prove that it will consistently work after these fixes. So with this limitation challenge "How to fix this?" can quickly turn into "What problemsetter exactly wanted from you?" and this challenge will not be so fun (if it will be fun at all).
And also large amount of changes is not always time consuming. Common refactoring methods are automated well, sometimes you can apply "Extract method" or "Rename" to change hundreds of lines of code within seconds.
In this format I would like to see given corrupted solution as a source of ideas and unreliable blocks of code, but not as a restriction. Just imagine receiving specificly obfuscated and unreadable code for a really simple problem without being able to change it significantly. Or imagine getting very tight resriction on $$$k$$$, say $$$k=2$$$. How do you even approach this? Most reasonable approach I see is to automatically apply all possible changes, try to compile changed codes and find ones that actually pass some tests.
Idea: if the plag checker says that the submitted solution coincides with the given buggy code, then the solution is considered a bug fix.
I took part in this contest where you had to write a failing test case for the code, which seems like a much better way of doing such a contest as compared to minimizing edit distance.
Isn't it hacking?
Sure, but the contest authors write the problems and code — so everyone competes to hack that code (which was much more readable for me than a random person's code in general).
I don't like this idea. People have their own codestyle. Their speed and quality of code reading depend on the features of the code. These are familiar and unfamiliar macros, some strange language constructions (like
while (p[i++] == a[--j])
or" \n"[i == n - 1]
), STL classes and functions (clamp
ornumeric_limits
), code formatting and so on.In general, there are many people, that don't use C++. Codeforces allows to use many languages in contests and your suggestion requires only one language in which the codes would be written.