mezhaka's blog

By mezhaka, 13 years ago, In English
I have written a little GreaseMonkey script for the automatic generation of the stub program with test cases. It works in Firefox if you install GreaseMonkey plugin or in Chrome (out of the box). The script modifies the problem description page and appends the source of the program to the bottom of the page, so you can copy-paste it into your favorite editor.

Implement your solution in the TheSolution function. Use input and output variables instead of the cin and cout in the TheSolution function.

Feel free to post any comments and bug reports. I can implement it for the other programming languages, if you sent me a suitable template.

You can install it from here: http://userscripts.org/scripts/show/117771 (click on the green Install button to the right).

UPDATE 12.01.2012
Updated the script. Now it works with a changed HTML of the site.

Full text and comments »

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

By mezhaka, 13 years ago, In English

I have failed to submit div. 2 B problem in round #92 with the "Time limit exceeded" verdict. Later I have modified my solution and now it does pass the test, but the interesting part of it is that the complexity of both is equivalent (please correct me if I am wrong). This is the first time I encounter such a problem. Usually if you got the solution with the right complexity it does pass the test. For those who are interested in looking at the code it is here: http://pastebin.com/scSwyuEq. The fast function is f, the slow one is f1 (if you want to run the slow one, then just swap the names).

Full text and comments »

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