Page 1 of 2

837 - Light and Transparencies

Posted: Thu Aug 01, 2002 2:05 pm
by gyojuoppa
I have tested my programs with other inputs such as the following:

3

3
2.0 2.0 9.0 2.0 0.9
13.5 2.0 4.0 8.5 0.7
17.0 10.0 7.0 8.5 0.8

8
6.0 2.0 24.0 2.0 0.9
5.5 2.0 22.0 8.5 0.7
9.0 10.0 18.0 8.5 0.8
16.0 2.0 16.0 2.0 0.9
8.5 2.0 15.0 8.5 0.7
4.0 10.0 11.0 8.5 0.8
2.2 2.0 5.0 2.0 0.9
90.5 2.0 1.0 8.5 0.7

2
1.0 2.0 2.0 2.0 0.9
4.5 2.0 6.0 8.5 0.7

and it gives 'logically' correct answers (which is the following:)

7
-inf 2.000 1.000
2.000 4.000 0.900
4.000 7.000 0.630
7.000 9.000 0.504
9.000 13.500 0.560
13.500 17.000 0.800
17.000 +inf 1.000

17
-inf 1.000 1.000
1.000 2.200 0.700
2.200 4.000 0.630
4.000 5.000 0.504
5.000 5.500 0.560
5.500 6.000 0.392
6.000 8.500 0.353
8.500 9.000 0.247
9.000 11.000 0.198
11.000 15.000 0.247
15.000 16.000 0.353
16.000 16.000 0.318
16.000 18.000 0.318
18.000 22.000 0.441
22.000 24.000 0.630
24.000 90.500 0.700
90.500 +inf 1.000

5
-inf 1.000 1.000
1.000 2.000 0.900
2.000 4.500 1.000
4.500 6.000 0.700
6.000 +inf 1.000

yet I keep on getting WA all the time...
could somebody check on this?

I have similar problems

Posted: Sun Sep 08, 2002 10:29 am
by UAMike
I have the same problem than you. We should think of more test cases, I suppose. For instance, I think that the solution for the second case you propose is wrong. Mine is:

15
-inf 1.000 1.000
1.000 2.200 0.700
2.200 4.000 0.630
4.000 5.000 0.504
5.000 5.500 0.560
5.500 6.000 0.392
6.000 8.500 0.353
8.500 9.000 0.247
9.000 11.000 0.198
11.000 15.000 0.247
15.000 18.000 0.353
18.000 22.000 0.441
22.000 24.000 0.630
24.000 90.500 0.700
90.500 +inf 1.000

This is because I think that segments with x1 = x2 should be ignored.

Regards,
UAMike

837 - Light and Transparencies

Posted: Sun Sep 15, 2002 8:48 am
by jacky
I tried following test cases, and failed with "Wrong Answer".

Input:
5

1
-0.3 3.0 1.5 3.0 1.0

1
-0.3 3.0 1.5 3.0 0.8

2
-0.3 3.0 1.5 3.0 1.0
2.0 3.0 -0.0 3.0 0.7

2
-0.3 3.0 1.5 3.0 1.0
2.0 3.0 -0.0 3.0 0.7

4
1 3.0 2 3.0 0.9
2 3.0 4 3.0 0.9
3 3.0 5 3.0 0.9
4 3.0 6 3.0 1.0


output:
1
-inf +inf 1.000

3
-inf -0.300 1.000
-0.300 1.500 0.800
1.500 +inf 1.000

3
-inf 0.000 1.000
0.000 2.000 0.700
2.000 +inf 1.000

3
-inf 0.000 1.000
0.000 2.000 0.700
2.000 +inf 1.000

5
-inf 1.000 1.000
1.000 3.000 0.900
3.000 4.000 0.810
4.000 5.000 0.900
5.000 +inf 1.000

Could somebody help me check it?

If interested, please paste your test cases on the board. Thanks very much.

p837 - Just 1 question

Posted: Fri Nov 15, 2002 4:41 am
by raugusto
So, anyone can tell me this:

When the input is(for example):

1
2.0 2.0 4.0 2.0 1.0

The output has to be:

1
-inf +inf 1.000

or can be:

3
-inf 2.000 1.000
2.000 4.000 1.000
4.000 +inf 1.000

Posted: Sat Nov 16, 2002 3:36 pm
by BJM
I match your answers except for the final test case which my code won't handle as well as yours. However, the problem states that none of the X values are co-incident so it isn't strictly necessary to handle these cases. :roll:

Posted: Tue Nov 19, 2002 2:28 pm
by palo
The transparency coefficients could be zero (I think). There are then some special cases. I think I handle zero coefficients but I've got wrong answer, too. And I have a question: Which is the correct answer for this input:

Input:
1

1
1 3 2 3 1

Ouput1:
1
-inf +inf 1.000

Output2:
3
-inf 1.000 1.000
1.000 2.000 1.000
2.000 +inf 1.000

Posted: Mon Dec 09, 2002 2:36 pm
by Grzesiek
How about negative Y? Can be ignored a filter being below zero?
(ignored = treated nonexistent).
If not, I don't see any meanning for Y. I also get WA, with
considering -Y or without.

Posted: Sun Jan 12, 2003 9:00 pm
by Caesum
There don't appear to be any negative y values there. I dont see the point in the Y values at all. Am I missing something in understanding this question ? I get the same values for the tests above as you others, but I am also WA.

Posted: Thu Jul 24, 2003 5:45 pm
by bobi1978
I think that you should not join parts with equal transparency.
That means:

INPUT:
1

1
1.0 2.0 5.0 2.0 1.0

OUPTUT:
3
-inf 1.000 1.000
1.000 5.000 1.000
5.000 +inf 1.000

I got Accepted without joining these neighbouring parts with equel transparecys.

Another thing:
I DID NOT CONCIDER NEGATIVE Y.

Posted: Mon Nov 17, 2003 8:38 pm
by Caesum
having finally solved this, the correct reply to the input above is:

3
-inf -0.300 1.000
-0.300 1.500 1.000
1.500 +inf 1.000

3
-inf -0.300 1.000
-0.300 1.500 0.800
1.500 +inf 1.000

5
-inf -0.300 1.000
-0.300 0.000 1.000
0.000 1.500 0.700
1.500 2.000 0.700
2.000 +inf 1.000

5
-inf -0.300 1.000
-0.300 0.000 1.000
0.000 1.500 0.700
1.500 2.000 0.700
2.000 +inf 1.000

7
-inf 1.000 1.000
1.000 2.000 0.900
2.000 3.000 0.900
3.000 4.000 0.810
4.000 5.000 0.900
5.000 6.000 1.000
6.000 +inf 1.000

Posted: Fri Jan 09, 2004 8:00 am
by jaywinyeah
A little more help please.
My program gets the same answers for that input, but still WA.
Are there any other tricks or special input? Thanks.

hmmm

Posted: Thu May 18, 2006 1:21 pm
by chuzpa
hi there could anyone tell me wich is the output for :

Code: Select all

5
1 1 3 1 0.2
2 2 4 2 0
3 3 6 3 0.7
5 4 6 4 0.6
7 5 8 5 0.1
is ...

Code: Select all

10
-inf 1.000 1.000
1.000 2.000 0.200
2.000 3.000 0.000
3.000 3.000 0.000
3.000 4.000 0.000
4.000 5.000 0.700
5.000 6.000 0.420
6.000 7.000 1.000
7.000 8.000 0.100
8.000 +inf 1.000
Or it should be the following ?

Code: Select all

8
-inf 1.000 1.000
1.000 2.000 0.200
2.000 4.000 0.000
4.000 5.000 0.700
5.000 6.000 0.420
6.000 7.000 1.000
7.000 8.000 0.100
8.000 +inf 1.000

Posted: Fri May 19, 2006 11:22 am
by chuzpa
I've found my mistake, and got Accepted :D ...

Posted: Wed May 16, 2007 7:22 am
by sjn
I have ACed this problem by using linked list which is very easy to understand but cost 100+ coding lines.

could anyone show me how to code just with array or something else?
thx in advance!

Re: 837 - Light and Transparencies

Posted: Sat Jan 15, 2011 2:58 pm
by blackgoldtimes
The outputs of two consecutive cases will be separated by a blank line.
So, the final case does not have a blank line. :P