10589 - Area

All about problems in Volume 105. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

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

Post by Adrian Kuegel » Mon Jan 12, 2004 11:22 am

As far as I know there was no rejudge so far, at least I didn't get a message about that.

Marcin Kwiatkowski
New poster
Posts: 5
Joined: Thu Jan 01, 2004 10:43 pm
Location: Gdynia, Poland

10589 - Area, critical test cases needed

Post by Marcin Kwiatkowski » Sun Jan 18, 2004 12:35 am

Could anybody give some critical test cases to this problem?
Thanks.
"Imagination is more important than knowledge" Albert Einstein

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

Post by Adrian Kuegel » Sun Jan 18, 2004 1:07 am

The judge output is wrong. Read this:
http://online-judge.uva.es/board/viewtopic.php?t=4748

User avatar
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post by little joey » Thu Mar 25, 2004 11:24 am

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.]

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

Post by Andrey Mokhov » Fri Mar 26, 2004 7:34 am

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 :wink:
We're not in the dark, I hope :P

Bye.
Andrey.

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:

Post by Dominik Michniewski » Thu Apr 29, 2004 12:43 pm

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
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)

User avatar
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post by little joey » Sat May 29, 2004 3:22 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 :)

..
A great helper
Posts: 454
Joined: Thu Oct 18, 2001 2:00 am
Location: Hong Kong

Post by .. » Tue Jun 01, 2004 8:04 pm

Yes, and it is not hard :wink:
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
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.

User avatar
Carlos
System administrator
Posts: 1286
Joined: Sat Oct 13, 2001 2:00 am
Location: Valladolid, Spain
Contact:

Judge's reply.

Post by Carlos » Wed Jun 02, 2004 10:39 am

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?

schindlersp
New poster
Posts: 28
Joined: Tue Aug 03, 2004 8:11 pm
Contact:

10589 - (wa) 12 help

Post by schindlersp » Wed Aug 11, 2004 1:59 am

:o
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]

User avatar
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

long double

Post by sohel » Wed Aug 11, 2004 7:06 am

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.

schindlersp
New poster
Posts: 28
Joined: Tue Aug 03, 2004 8:11 pm
Contact:

10589 ac

Post by schindlersp » Wed Aug 11, 2004 8:45 pm

Guru, :D thanxs for help i changed long double to long long

geran
New poster
Posts: 13
Joined: Sun Jun 19, 2005 4:36 pm

10589 help

Post by geran » Sat Aug 06, 2005 11:52 pm

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:

Code: Select all

100.00000
from test data

Code: Select all

1 10
5.0000000 5.0000000
0 0
but how can I get the correct output with five digits after the decimal point
Last edited by geran on Sun Aug 07, 2005 4:29 am, edited 1 time in total.

geran
New poster
Posts: 13
Joined: Sun Jun 19, 2005 4:36 pm

Post by geran » Sun Aug 07, 2005 4:25 am

I think I got the right output format, but I get WA, can somebody please post more input data?

User avatar
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Re: 10589 help

Post by Martin Macko » Fri Sep 09, 2005 12:19 am

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?
geran wrote:

Code: Select all

	return 1;
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

Code: Select all

24.20000
BTW, have you read all topics on this problem?

Post Reply

Return to “Volume 105 (10500-10599)”