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

Автор Infoshoc, история, 8 лет назад, По-английски

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?

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

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

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.