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

Автор mezhaka, 12 лет назад, перевод, По-русски
Я написал  GreaseMonkey скрипт для генерации текста программы-пустышки с тестовыми входными-выходными данными. Работает в Firefox, если вы поставите GreaseMonkey плагин или для Chrome без всяких плагинов. Скрипт добавляет в конец страницы с описанием задачи текст C++ программы в которой выполняются тесты. Эту радость можно скопировать в ваш любимый текстовый редактор. Решение нужно поместить в тело функции TheSolution. Внутри этой функции необходимо использовать  переменные output и input вместо cout и cin.

Могу сделать для како-нибудь другого языка, если пришлёте мне шаблон.

Скрипт можно взять здесь: http://userscripts.org/scripts/show/117771

UPDATE 12.01.2012
Обновил, теперь работает с новой разметкой на сайте.
  • Проголосовать: нравится
  • +12
  • Проголосовать: не нравится

12 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
I don't understand how it should be used: I installed (it says it is installed) but when I go to a problem's page like http://www.codeforces.com/contest/126/problem/A I don't see anything new at the bottom...
Am I missing something? Thanks in advance :)
  • 12 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    Hmm... You should see the generated code at the bottom of the page... Perhaps the problem is that you have www in your adress and this doesn't match the pattern, that the script is adjusted for. Could you try http://codeforces.com/contest/126/problem/A instead? If it works, than this is the problem and let me know -- I would then update the script and add the pattern with www.
    • 12 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится
      Yes, now it works!
      Awesome job, dude :)

      It would be nice to allow template editing ;)
12 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
This is amazing, thanks and good job! I'm just wondering if this doesn't break any rule, like obfuscation or using too much unused code. Could someone clarify this? Thanks.
  • 12 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    I don't think you have to send the testing code along with your program, so the "unused code" won't be sent. Maybe this script will give an advantage to who use it (one-click testing) but this happens normally on TopCoder so we shouldn't worry about that.
12 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
It seems the layout has changed and it does not work now. Hope you'll read it now, so you won't be surprised during the following round. Meanwhile I'll try to come up with a fix.
  • 12 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +8 Проголосовать: не нравится

    Hello,I feel it very useful on coding.However if the sample input and output can be terminated by '\n',there will be much more better.

    Because I always got "not ok",and i find my solution always add extra '\n'.
    Although the presentation format have no effect on the answer,I hope to get a better usage~~ Thanks. 
»
12 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится
Hi, cool thing.
But there is another unsignificant bug in url patterns:
// @include        http://codeforces./problemset/problem/*/*
// @include        http://www.codeforces./problemset/problem/*/*