10589 - Area
Moderator: Board moderators
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
-
- New poster
- Posts: 5
- Joined: Thu Jan 01, 2004 10:43 pm
- Location: Gdynia, Poland
10589 - Area, critical test cases needed
Could anybody give some critical test cases to this problem?
Thanks.
Thanks.
"Imagination is more important than knowledge" Albert Einstein
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
The judge output is wrong. Read this:
http://online-judge.uva.es/board/viewtopic.php?t=4748
http://online-judge.uva.es/board/viewtopic.php?t=4748
-
- Guru
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
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.]
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.]
-
- Experienced poster
- Posts: 128
- Joined: Fri Nov 15, 2002 7:45 am
- Location: Kyrgyzstan
-
- Guru
- Posts: 834
- Joined: Wed May 29, 2002 4:11 pm
- Location: Wroclaw, Poland
- Contact:
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
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
If you really want to get Accepted, try to think about possible, and after that - about impossible ... and you'll get, what you want ....
Born from ashes - restarting counter of problems (800+ solved problems)
Born from ashes - restarting counter of problems (800+ solved problems)
-
- Guru
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
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![:)](./images/smilies/icon_smile.gif)
[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
![:)](./images/smilies/icon_smile.gif)
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![:P](./images/smilies/icon_razz.gif)
![:wink:](./images/smilies/icon_wink.gif)
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
![:P](./images/smilies/icon_razz.gif)
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.
-
- System administrator
- Posts: 1286
- Joined: Sat Oct 13, 2001 2:00 am
- Location: Valladolid, Spain
- Contact:
Judge's reply.
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?
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?
-
- New poster
- Posts: 28
- Joined: Tue Aug 03, 2004 8:11 pm
- Contact:
10589 - (wa) 12 help
![:o](./images/smilies/icon_eek.gif)
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
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.2: read (x, y) x *= 10000000 , y *= 10000000 (type x and y == long double)
-
- New poster
- Posts: 28
- Joined: Tue Aug 03, 2004 8:11 pm
- Contact:
10589 ac
Guru,
thanxs for help i changed long double to long long
![:D](./images/smilies/icon_biggrin.gif)
10589 help
How should I print the result?
I got the code:
and I get the output:
from test data
but how can I get the correct output with five digits after the decimal point
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;
}
Code: Select all
100.00000
Code: Select all
1 10
5.0000000 5.0000000
0 0
Last edited by geran on Sun Aug 07, 2005 4:29 am, edited 1 time in total.
-
- A great helper
- Posts: 481
- Joined: Sun Jun 19, 2005 1:18 am
- Location: European Union (Slovak Republic)
Re: 10589 help
Why not checking dist(x,y,a,a)<=a?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 returning 1 not 0?geran wrote:Code: Select all
return 1;
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
Code: Select all
24.20000