Infoshoc's blog

By Infoshoc, history, 8 years ago, In English

I suppose as a person with rating terribly going down this post will receive plenty downvotes, but still.

I suppose anyone, who used hacking with generator (and considering limit on file size for handmade tests, when you are hacking for TL another ways are impossible), hates messages like "Invalid input Unexpected character #13, but ' ' expected". Personally I receive them every time, and considering pending time... In other words it almost impossible to hack someone with generator (for me, do you have any tricks?) My offer, is for problem-setters provide another program for each problem (excuse me, I know you already have written no less then 4 and also statements...), something between checker and generator — it will read like checker and output like generator. And simply redirect user's generator output to input of this program and output to validator and hacked program.

Another solution is smth like topcoder style: authors provides output function and user has to fill it's parameters.

If the above mentioned problem is not just nightmare of mine and there are other users who suffers as well, what do you think?

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

»
8 years ago, # |
Rev. 2   Vote: I like it +74 Vote: I do not like it

The goal of the strict validator is to be sure that the input data is valid. I don't see why a setter should deal with what you described. You should just learn how to write a generator.

Just don't print space at the end of line. So, instead of:

for(int i = 1; i <= n; i++) printf("%d ", i);
puts("");

rather use:

for(int i = 1; i <= n; i++) {
	printf("%d", i);
	if(i != n) printf(" ");
}
puts("");

You can practice writing a correct generator:

  1. Download testlib library together with sample validators (link).
  2. For each sample validator understand the format and write a generator (or many generators) to create some tests. Do it as you would do it during the contest.
  3. Run provided validators on your generated tests.
  • »
    »
    8 years ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    OK, Thanks. I hope this is always that way!