Page 2 of 4
Posted: Mon Jan 12, 2004 11:22 am
by Adrian Kuegel
As far as I know there was no rejudge so far, at least I didn't get a message about that.
10589 - Area, critical test cases needed
Posted: Sun Jan 18, 2004 12:35 am
by Marcin Kwiatkowski
Could anybody give some critical test cases to this problem?
Thanks.
Posted: Sun Jan 18, 2004 1:07 am
by Adrian Kuegel
Posted: Thu Mar 25, 2004 11:24 am
by little joey
Almost three months later:
Is it fixed yet?
I see nothing in the "Fixing Mistakes" section, so I suppose not. Then why is this problem submittable when it's known to be wrong?
[I post this message just out of formality. I know noboddy will reply ... the judges are busy, the problemsetters are busy, so we're left in the dark. Sigh.]
Posted: Fri Mar 26, 2004 7:34 am
by Andrey Mokhov
little joey wrote:I post this message just out of formality. I know noboddy will reply ... the judges are busy, the problemsetters are busy, so we're left in the dark. Sigh
Me replies
We're not in the dark, I hope
Bye.
Andrey.
Posted: Thu Apr 29, 2004 12:43 pm
by Dominik Michniewski
I want to ask for something:
Is still problem with judge's input ? I try several submit (with I think right code) but always got WA ...
Of course, I can have a mistake in code, but I don't know where... I don't use doubles at all, all calculations I made using long longs ...
Best regards
DM
Posted: Sat May 29, 2004 3:22 pm
by little joey
The judges' data is still incorrect... Got AC for the wrong reason
[c] /* wrong, but the only way to get AC: */
sprintf(s,"%lld",result%points);
for(i=0;i<5;i++) if(!isdigit(s
)) break;
for(;i<5;i++) s='0';
s[5]='\0';
printf("%lld.%s\n",result/points,s);
[/c][c]
/* should give correct result: */
sprintf(s,"%lld",100000+(result%points)*(100000/points));
printf("%lld.%s\n",result/points,&s[1]);
[/c]
Is there any way to correct the judges' data? Can't be too hard 
Posted: Tue Jun 01, 2004 8:04 pm
by ..
Yes, and it is not hard
Send a email to
problemset@acm.uva.es and saying you want to correct the test data of this problem, that's all.
Actually I "wanted" to do the correction, but just too lazy to write the email

Judge's reply.
Posted: Wed Jun 02, 2004 10:39 am
by Carlos
The last post was right, if you think any test case for any problem is wrong, mail us at
problemset@acm.uva.es. We can't read every post on the forum!
Someone mailed us telling what was going wrong...so I solved the problem and compared with judge's output. You were right, judge's output had a problem with 0's.
It's solved now, we're rejudging every submission. It will be done by 2 hours more or less.
Sorry for the long delay, but next time mail us,ok?
10589 - (wa) 12 help
Posted: Wed Aug 11, 2004 1:59 am
by schindlersp
I dont know ... is it so hard? i got 12 (wa)
my last program wrong
1 : read (n, a) a *= 10000000
2: read (x, y) x *= 10000000 , y *= 10000000 (type x and y == long double)
3: if (ditance (x,y) -> (a,a) > a ||
ditance (x,y) -> (0,0) > a ||
ditance (x,y) -> (0,a) > a ||
ditance (x,y) -> (a,0) > a ) /*not do*/
else M++ ;
if read < n goto 2
4: result = a * a * M
5: sprintf(output,"%lld",100000+(result%n)*(100000/n));
printf("%lld",result/n); printf(".%result\n",output+1);
Thanxss
[cpp][/cpp]
long double
Posted: Wed Aug 11, 2004 7:06 am
by sohel
2: read (x, y) x *= 10000000 , y *= 10000000 (type x and y == long double)
I think there could be a problem with this line. Try to avoid the usage of long double for this problem and see what happens.
10589 ac
Posted: Wed Aug 11, 2004 8:45 pm
by schindlersp
Guru,

thanxs for help i changed long double to long long
10589 help
Posted: Sat Aug 06, 2005 11:52 pm
by geran
How should I print the result?
I got the code:
Code: Select all
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define dist(x1,y1,x2,y2)(sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)))
int main() {
long long x,y,a,m,result;
int in_n, in_a;
double in_x,in_y;
char t[256];
while(1) {
memset(t,0,sizeof(char)*256);
m = 0;
result = 0;
scanf("%d %d",&in_n, &in_a);
if(in_n == 0) {
return 1;
}
a = (long long)in_a;
for(int i = 0; i < in_n; i++) {
scanf("%lf %lf",&in_x,&in_y);
x = (long long)in_x;
y = (long long)in_y;
x = x;
y = y;
if(dist(x,y,0,0) <= a || dist(x,y,0,a) <= a || dist(x,y,a,0) <= a) {
m++;
}
}
result = ((a*100000)*(a*100000)*m)/in_n;
sprintf(t,"%lld",100000+(result%in_n)*(100000/in_n));
result = (a * a * m)/in_n;
printf("%lld.",result);
printf("%s\n",&t[1]);
}
return 1;
}
and I get the output:
from test data
but how can I get the correct output with five digits after the decimal point
Posted: Sun Aug 07, 2005 4:25 am
by geran
I think I got the right output format, but I get WA, can somebody please post more input data?
Re: 10589 help
Posted: Fri Sep 09, 2005 12:19 am
by Martin Macko
geran wrote:Code: Select all
if(dist(x,y,0,0) <= a || dist(x,y,0,a) <= a || dist(x,y,a,0) <= a) {
m++;
}
Why not checking dist(x,y,a,a)<=a?
Why returning 1 not 0?
Your code is not working for:
Code: Select all
10 11
5.5 5.5
5.5 5.5
0.0 0.0
0.0 0.0
0.0 0.0
0.0 0.0
0.0 0.0
0.0 0.0
0.0 0.0
0.0 0.0
0 0
The output should be
BTW, have you read all topics on this problem?