Блог пользователя US3RN4M3

Автор US3RN4M3, история, 2 года назад, По-английски

I think it's no secret that nearly everyone on this website who wants some sort of edge against the average participant uses some sort of premade header; with macros, typedefs, includes, and complexities ranging all the way to entire advanced data structures implemented as classes for ease of use. My suggestion to make this concept more streamlined and easier to use is as follows:

Every user is allowed a personal header folder, linked to their account, with a limit of... say... 64kb, such that every time they submit a file, the Codeforces grading system will compile/run said file with -I/my_include_directory/ (or other language equivalents). They would of course have the ability to edit this folder as seen fit. This would remove the necessity to copy paste the (sometimes excessively long) headers into the source file. Which improves not only usability, but also the hacking experience. Many times when attempting to hack, I come across solution files with ridiculously long headers, with absolutely no readability. While this technically does not fall under the category of obfuscation, complicated headers that blur the line between solution and premade code sometimes achieve a similar effect. By implementing this suggestion, headers will be made more viable, easier to use, and incentivize the decluttering of solution files to make for a better hacking experience.

Thoughts? Criticism? Let me know...

  • Проголосовать: нравится
  • +110
  • Проголосовать: не нравится

»
2 года назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

I actually had this same idea, and I really hope it gets implemented at some point.

In order to decrease the possibility of obfuscation w/headers during rounds, my solution would be to temporarily freeze all headers while a contest is running.

  • »
    »
    2 года назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится

    Yeah this sounds like a good improvement. Either that, or once a solution is submitted, codeforces associates a frozen instance of that header at the time of submission with the source. And when you view it, you’ll see both side by side.

»
2 года назад, # |
  Проголосовать: нравится +44 Проголосовать: не нравится

Great idea, a downside would be more annoying to hack. Assuming the headers would be forceably public, sometimes you'd have to go all the way to the person's personal directory to find out what a macro does or search for anything vulnerable in their ds implementations, rather than it being right there at the top of their code.

  • »
    »
    2 года назад, # ^ |
    Rev. 3   Проголосовать: нравится +55 Проголосовать: не нравится

    Agreed--if anything, this seems like it could make hacking more annoying. Compared to existing solutions including long headers, I don't think this would significantly change the difficulty of hacking errors in the main function (even when code has lots of headers, I don't think it's too hard to scroll down to the main solution), and I think it would make hacking errors in template code much harder. Under this system, you'd need to navigate through the headers to have any chance of finding the error--at least when all code must be included in the main file, you have some sense of where to look for the error and don't need to navigate through lots of files.

    That said, I view hacking as an increasingly unimportant part of the Codeforces experience (though I grant that many people disagree with me on this...), so I don't think "it would make hacking marginally more unpleasant" is an especially compelling reason not to implement this feature. My bigger concern is that I don't view this as especially helpful, since inconvenience of copying/pasting library code is relatively minor (on Vim, all I have to do to get a segtree is :r ~/cpl/Segtree.cpp, and including a segtree library would take at least this much typing). Moreover, much library code has to be modified for the individual problem, which further reduces the utility of this system. As a result, I don't think this is a sufficiently necessary change to justify devoting limited development time to its implementation.

    Of course, maybe I'm mistaken--other competitors, would you find something along these lines helpful? From my POV, I'm happy with the setup I use now and would probably not make use of headers even if this feature was permitted, but maybe others would find this more useful than I would. That said, this is definitely a creative idea, and I appreciate the thought given to improving Codeforces' user experience.

  • »
    »
    2 года назад, # ^ |
    Rev. 2   Проголосовать: нравится +15 Проголосовать: не нравится

    dont worry i have a solution; i will just add an assert(n!=42); to my segtree copypaste so if custom headers ever get implemented you can still hack me by making size 42 inputs :D. (i am informing everyone here ahead of time)

»
2 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

A week ago I almost started write similar blog :D So to mentioned issues above (submission page, hacking, obfuscation, pressure on devs) I will add thought as cp-lib jerk.

Many coders as me support own github repository and of course they don't want to push twice some new changes. Many coders used ACL in their submissions. This comes to if cf will have such feature then it must support cloning/mirroring outside code bases as github/gitlab.

And if it will then what if I want to use not only ACL but some of sslotin or ecnerwala?..

All this look very expensive for devs and maybe for system (we want the same speed as cf gym problems hooks updates from polygon)