In my opinion, your test case is completely insane. Problemsetters should care more about the problem statement than about making stupid input for the judge. I don't think you can be proud of making some people spent their time to get AC in this problem.
luishhh wrote:In my opinion, your test case is completely insane. Problemsetters should care more about the problem statement than about making stupid input for the judge. I don't think you can be proud of making some people spent their time to get AC in this problem.
1) The problem says "dissect/divide a regular hexagon into n parallelograms of equal area", not make.
This means that the entire area of the haxagon must be covered by the parallelograms!
In otherwords, sum of the area of the parallelograms = area of hexagon.
If you make no parallelograms, the total area of them sum to 0,
which is not equal to the area of the hexagon. In english, dissect actually
means cut ... and into means that the hexagon must no longer
exist after the cutting... the hexagon becomes n parallelograms.
If you make 0 parallelograms, then the hexagon still exist!!!
2) If the first non-space character is "-", then your should return 0.
You know that it is negative. The problem says "otherwise return 0".
baodog wrote:1) The problem says "dissect/divide a regular hexagon into n parallelograms of equal area", not make.
This means that the entire area of the haxagon must be covered by the parallelograms!
In otherwords, sum of the area of the parallelograms = area of hexagon.
If you make no parallelograms, the total area of them sum to 0,
which is not equal to the area of the hexagon. In english, dissect actually
means cut ... and into means that the hexagon must no longer
exist after the cutting... the hexagon becomes n parallelograms.
If you make 0 parallelograms, then the hexagon still exist!!!
2) If the first non-space character is "-", then your should return 0.
You know that it is negative. The problem says "otherwise return 0".
Assume that the input file can be read well within
the time limit of 6 seconds. There are countless problems
in the archive that says "a number of inputs" or "read in a text".
It is assumed they can be read in within the time limit, and
many more where numerical precision is not specified (double, float
, or infinite?).
For practical purposes, it's impossible to even submit
such a large test file by email to the archive.
In c/c++ gets(), fread() are faster functions. So, a dataset can be made where your scanf() will time out in reading but gets() won't.
And of course this is not the proper way to set judge data. The reason is you shouldn't trick people in reading the dataset. A good problem can have tricks, and of course the tricks should make sense.
For this problem you can say that for n = 0 the answer is 0. And yes, its a nice trick cause we have to dissect the hexagon (you described already). But I am sorry to say that the negative integers are clearly non-sense for this problem. May be you should think a while, I am sure that you will come up to this conclusion, too.
It's just a one time, experimental nasty trick to get newbie programmers to check data range more carefully. Nothing more. Does negative inputs make sense? Of course not . That's why the problem says "otherwise return 0". However, I won't use such tricks in the future.
Of course, the real story is that I was watching football and drinking beer after work when I made the dataset... but that's another story.