837 - Light and Transparencies

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

Moderator: Board moderators

gyojuoppa
New poster
Posts: 1
Joined: Thu Aug 01, 2002 1:57 pm
Location: New Zealand
Contact:

837 - Light and Transparencies

Post by gyojuoppa » Thu Aug 01, 2002 2:05 pm

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?

UAMike
New poster
Posts: 1
Joined: Sun Sep 08, 2002 10:25 am

I have similar problems

Post by UAMike » Sun Sep 08, 2002 10:29 am

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

jacky
New poster
Posts: 1
Joined: Sun Sep 15, 2002 8:32 am

837 - Light and Transparencies

Post by jacky » Sun Sep 15, 2002 8:48 am

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.

raugusto
New poster
Posts: 1
Joined: Fri Nov 15, 2002 4:37 am

p837 - Just 1 question

Post by raugusto » Fri Nov 15, 2002 4:41 am

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

BJM
New poster
Posts: 7
Joined: Sat Nov 16, 2002 3:28 pm

Post by BJM » Sat Nov 16, 2002 3:36 pm

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:

palo
New poster
Posts: 1
Joined: Tue Nov 19, 2002 2:17 pm

Post by palo » Tue Nov 19, 2002 2:28 pm

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

Grzesiek
New poster
Posts: 8
Joined: Thu Feb 14, 2002 2:00 am

Post by Grzesiek » Mon Dec 09, 2002 2:36 pm

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.

Caesum
Experienced poster
Posts: 225
Joined: Fri May 03, 2002 12:14 am
Location: UK
Contact:

Post by Caesum » Sun Jan 12, 2003 9:00 pm

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.

bobi1978
New poster
Posts: 13
Joined: Tue Jul 22, 2003 1:57 pm
Location: Kavadarci, Macedonia
Contact:

Post by bobi1978 » Thu Jul 24, 2003 5:45 pm

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.

Caesum
Experienced poster
Posts: 225
Joined: Fri May 03, 2002 12:14 am
Location: UK
Contact:

Post by Caesum » Mon Nov 17, 2003 8:38 pm

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

jaywinyeah
New poster
Posts: 19
Joined: Sun Aug 17, 2003 10:40 pm

Post by jaywinyeah » Fri Jan 09, 2004 8:00 am

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.
LL Cool Jay
The Formula Wizard
Jason Winokur

chuzpa
New poster
Posts: 33
Joined: Fri Jun 18, 2004 8:39 am
Location: Mexico
Contact:

hmmm

Post by chuzpa » Thu May 18, 2006 1:21 pm

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

chuzpa
New poster
Posts: 33
Joined: Fri Jun 18, 2004 8:39 am
Location: Mexico
Contact:

Post by chuzpa » Fri May 19, 2006 11:22 am

I've found my mistake, and got Accepted :D ...

sjn
Learning poster
Posts: 73
Joined: Mon Apr 08, 2002 8:22 am
Contact:

Post by sjn » Wed May 16, 2007 7:22 am

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!

blackgoldtimes
New poster
Posts: 1
Joined: Fri Jul 23, 2010 5:25 pm

Re: 837 - Light and Transparencies

Post by blackgoldtimes » Sat Jan 15, 2011 2:58 pm

The outputs of two consecutive cases will be separated by a blank line.
So, the final case does not have a blank line. :P

Post Reply

Return to “Volume 8 (800-899)”