10589  Area
Moderator: Board moderators
10589  Area
This is a pretty straight forward problem but I can't understand why do I keep geting WA. Nothing much to think about either. Precision shouldn't be a headache here becuase long double can be as precise as 10e17. Thus achieving a precision of 10e5/7 shouldn't take any trouble at all. I have a feeling that there is something wrong in the judge input/output. The problemsetter need to recheck everything. If the problemsetter was wanting us to use string based floating number arithmetic to meet the precision requirements of this problem then he has certainly mistaken. This problem clearly doesn't ask for that. Please rethink on this point. One more thing, the problem description doesn't say the precision or number of digits after decimal of "a" in the the input. If there is any trick in that then that is certainly not fair. Not specifying this little things is ok but in case input set has value of "a" with very high precision then thats no trick. Thats cheating.
The problemsetter should review the problem. That should atleast make him correct the one mistake that is clearly visible on the problem description. The formula given there should be A = (M*a*a/N) [a instead of b].
It is really annoying when such easy problems don't get AC for no reason at all.
Hope others agree with me.
I'm sorry if I've been a little rude but you know how it feels.
Dreamer
The problemsetter should review the problem. That should atleast make him correct the one mistake that is clearly visible on the problem description. The formula given there should be A = (M*a*a/N) [a instead of b].
It is really annoying when such easy problems don't get AC for no reason at all.
Hope others agree with me.
I'm sorry if I've been a little rude but you know how it feels.
Dreamer
Last edited by Dreamer#1 on Sun Dec 28, 2003 12:03 am, edited 1 time in total.
Not all of our dreams can be made to come true. But still we live with the hope to turn them into reality someday.
I can't find any reason to use long long . Long double is the only thing required here. Don't forget, 0<=M<=N<10e6, 10<=a<100.Try using long long's.. read the problem carefully..
Thus, using A = (M*a*a/N), 0<=A<10000
Am I right?
Thanks for your reply.
Dreamer
Not all of our dreams can be made to come true. But still we live with the hope to turn them into reality someday.

 System administrator & Problemsetter
 Posts: 399
 Joined: Sat Jan 12, 2002 2:00 am
hmm
The judge data may still have some mistake. Let me check. Don't try it now.

 Learning poster
 Posts: 63
 Joined: Mon Dec 22, 2003 5:05 am
 Location: Russia, Chelyabinsk
 Contact:
Re: AC..
I have tried long long for input data (fscanf (in,"%lf",&a); b=a*10000000;}CelebiX wrote:I have just tried this 0.0%rated problem and got accepted in a few trials.
The key is high precision  simply using double or long double may not be sufficient.
Try to "magnify" the input numbers.
But I my solution still WA (

 System administrator & Problemsetter
 Posts: 399
 Joined: Sat Jan 12, 2002 2:00 am
Re: AC..
Mail me your code at shahriar@neksus.comrotoZOOM wrote:I have tried long long for input data (fscanf (in,"%lf",&a); b=a*10000000;}CelebiX wrote:I have just tried this 0.0%rated problem and got accepted in a few trials.
The key is high precision  simply using double or long double may not be sufficient.
Try to "magnify" the input numbers.
But I my solution still WA (

 Guru
 Posts: 724
 Joined: Wed Dec 19, 2001 2:00 am
 Location: Germany
I think it means that the only numbers for n that are used in the input are 1, 10, 100, 1000, 10000 and 100000 (and I verified that by inserting an endless loop if n is not one of these). Because of this the output number can always be exactly written with 5 digits after the decimal point (no rounding necessary, and I avoided the usage of double entirely).
And I also read the input by ignoring the '.', that is exactly as if I would multiply each number by 10000000. Anyway, I didn't got Accepted so far.
And I also read the input by ignoring the '.', that is exactly as if I would multiply each number by 10000000. Anyway, I didn't got Accepted so far.

 Learning poster
 Posts: 63
 Joined: Mon Dec 22, 2003 5:05 am
 Location: Russia, Chelyabinsk
 Contact:
I got AC.Adrian Kuegel wrote:I think it means that the only numbers for n that are used in the input are 1, 10, 100, 1000, 10000 and 100000 (and I verified that by inserting an endless loop if n is not one of these). Because of this the output number can always be exactly written with 5 digits after the decimal point (no rounding necessary, and I avoided the usage of double entirely).
And I also read the input by ignoring the '.', that is exactly as if I would multiply each number by 10000000. Anyway, I didn't got Accepted so far.
I did the same as you wrote.
First I use long long for ALL calculation.
Second, I read input coordinates like you (ignore point) (long long).
Third, I do
sprintf (t,"%lld.%lld",res/n,res%n)
then just add '0' unless there are 5 digits after decimal point.
And don't forget about 'Each output on separate line'
Shahriar Manzoor, could you please check if the input/output is correct?
I have got AC, but I find that my code is actually wrong for some case.
At first I keep getting WA by this:
After I used this method, I got AC.
But I find that,
for the case, a = 10, 59049 out of 100000 points in the region,
My AC code gives the output 59.49000(wrong), but my WA code gives the output 59.049(correct). I wonder if there is such case in the input/output.
Anyway, Adrian do you use this?
If no, please try to see if this helps you AC.
I have got AC, but I find that my code is actually wrong for some case.
At first I keep getting WA by this:
Code: Select all
sprintf (t,"%d",res);
// and then I will use memmove to shift some bytes by one byte later and add the ''.'
Code: Select all
sprintf (t,"%lld.%lld",res/n,res%n)
for the case, a = 10, 59049 out of 100000 points in the region,
My AC code gives the output 59.49000(wrong), but my WA code gives the output 59.049(correct). I wonder if there is such case in the input/output.
Anyway, Adrian do you use this?
Code: Select all
sprintf (t,"%lld.%lld",res/n,res%n)
My signature:
 Please make discussion about the algorithm BRFORE posting source code.
We can learn much more in discussion than reading source code.  I HATE testing account.
 Don't send me source code for debug.

 New poster
 Posts: 30
 Joined: Sat Nov 30, 2002 1:04 pm

 System administrator & Problemsetter
 Posts: 399
 Joined: Sat Jan 12, 2002 2:00 am
hello
Mr. ..
Send me your both codes right and wrong.
I made a mistake, thought i corrected it just to make another mistake. Want to make sure this time it is right
Shahriar
Send me your both codes right and wrong.
I made a mistake, thought i corrected it just to make another mistake. Want to make sure this time it is right
Shahriar

 Guru
 Posts: 724
 Joined: Wed Dec 19, 2001 2:00 am
 Location: Germany

 Experienced poster
 Posts: 128
 Joined: Fri Nov 15, 2002 7:45 am
 Location: Kyrgyzstan