329 - PostScript Emulation

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

Moderator: Board moderators

Post Reply
Astrakan
New poster
Posts: 24
Joined: Sun Nov 03, 2002 12:18 pm
Location: Sweden

329 PostScript Emulation

Post by Astrakan »

Hi!

I have trouble getting my solution to 329 accepted, even though I have used a PostScript viewer to see that the output of my program gives the same drawing as the input.

It would be great if someone could check the sample in/out I have provided below and see if the output is correct.

Input:

Code: Select all

100 100 translate
10.5 23 moveto
11 rotate
34 45 rlineto
1.1 -2.2 scale
10 10 rmoveto
3.3 6.6 translate
33.6 2.5 lineto
-77.7 rotate
30 22.2 rmoveto
0.4 -0.3 scale
4 rotate
40 40 rlineto
*
My output:

Code: Select all

110.500000 123.000000 moveto
24.788919 50.660729 rlineto
14.995697 -19.496899 rmoveto
143.664243 88.092761 lineto
20.002864 58.980977 rmoveto
-17.331488 35.252458 rlineto
Thanks in advance!

jpfarias
Learning poster
Posts: 98
Joined: Thu Nov 01, 2001 2:00 am
Location: Brazil
Contact:

329 - PostScript Emulation

Post by jpfarias »

Hi!

I'm thinking the input/output of problem 329 is wrong, cause there's just 2 accepted solutions, and my solution (with matrix) is getting WA, and it is ok for the original data set, from North American Regionals in 1993.

Can anyone answer if it really is wrong? Is there a Valladolid administrator in the board?

Thanks,

JP!

Dmytro Chernysh
Experienced poster
Posts: 146
Joined: Sat Apr 26, 2003 2:51 am

Post by Dmytro Chernysh »

I guess, you should mail Carlos - problemset@acm.uva.es

jpfarias
Learning poster
Posts: 98
Joined: Thu Nov 01, 2001 2:00 am
Location: Brazil
Contact:

Problem output really is wrong...

Post by jpfarias »

Hi!

I've talked with Carlos via email/MSN and we were almost done fixing the problem with the input/output of this problem.

At first, he really agreeded that his solutions was wrong and proposed a correct solution for the problem, and convinced me that my solution was wrong.

I was really frustated, cause I thought my solution was ok, but changed my program and got AC with his help.

But I really think my original solution is the one that is correct, cause I've added some commands in the input/output of his solution to see the images generated in a PostScript viewer, and they differ!!! My solution's output generates the same drawing as the input, while his solution output generates a different drawing.

Trying to contact him by email/MSN again, I had no answer.

He told me that he was rejudging some solutions and some people is getting AC, but if my solution is correct, then I think these AC's will be rejudged to WA again :)

I'm posting this message here with the hope that responsble administrators read it and solve this problem definitely.

Bellow are the input/output he sent me telling the output is correct:

input:

Code: Select all

300 300 moveto
0 72 rlineto
0 0 rlineto
0 0 rmoveto
0 rotate
2 1 scale
36 0 rlineto
1 -4 scale
0 18 rlineto
1 -0.25 scale
0.5 1 scale
300 300 translate
90 rotate
0 0 moveto
0 72 rlineto
2 1 scale
36 0 rlineto
1 -4 scale
0 18 rlineto
300 300 moveto
0 72 rlineto
0 0 rlineto
0 0 rmoveto
0 rotate
2 1 scale
36 0 rlineto
1 -4 scale
0 18 rlineto
1 -0.25 scale
0.5 1 scale
300 300 translate
274 rotate
0 0 moveto
0 72 rlineto
2 1 scale
36 -0.1 rlineto
-1 4 scale
1 17.1 rlineto
-85.4 rotate
0 72 rlineto
2 1 scale
36 -0.1 rlineto
-1 4 scale
1 17.1 rlineto
*
output:

Code: Select all

300.000000 300.000000 moveto
0.000000 72.000000 rlineto
0.000000 0.000000 rlineto
0.000000 0.000000 rmoveto
72.000000 0.000000 rlineto
0.000000 -72.000000 rlineto
300.000000 300.000000 moveto
-72.000000 0.000000 rlineto
0.000000 72.000000 rlineto
72.000000 0.000000 rlineto
1500.000000 900.000000 moveto
288.000000 0.000000 rlineto
0.000000 0.000000 rlineto
0.000000 0.000000 rmoveto
0.000000 144.000000 rlineto
-288.000000 0.000000 rlineto
1500.000000 900.000000 moveto
20.089864 -287.298446 rlineto
143.621321 10.443958 rlineto
15.095115 -273.212550 rlineto
-1139.047351 -172.264716 rlineto
-41.484169 285.001094 rlineto
-1080.898701 -171.561531 rlineto
And here is my output:

Code: Select all

300 300 moveto
0 72 rlineto
0 0 rlineto
0 0 rmoveto
72 0 rlineto
0 -72 rlineto
300 300 moveto
-72 0 rlineto
0 72 rlineto
72 0 rlineto
1500 900 moveto
288 0 rlineto
0 0 rlineto
0 0 rmoveto
0 144 rlineto
-288 0 rlineto
1500 900 moveto
20.0898 143.649 rlineto
-287.326 9.84534 rlineto
27.0659 136.188 rlineto
579.191 26.0569 rlineto
-34.8231 -574.393 rlineto
551.176 40.7084 rlineto
If you have a PostScript viewer, add the following lines to the beginning of the file:

Code: Select all

newpath
0 setlinewidth
And these to the end:

Code: Select all

stroke
showpage
Remember to delete the * in the end of the input....

To see the results and comprove my output is the same drawing as the input, and his output is different.

JP!

jpfarias
Learning poster
Posts: 98
Joined: Thu Nov 01, 2001 2:00 am
Location: Brazil
Contact:

Corrected!

Post by jpfarias »

Hi!

I finally talked to Carlos and we corrected the output of the judge, and he is rejudging the submissions right now.

I hope people can get AC now. I got :)

PS: He is still trying to make his solution work as good as mine :) (just kidding Carlos).

JP!

anupam
A great helper
Posts: 405
Joined: Wed Aug 28, 2002 6:45 pm
Contact:

Post by anupam »

yes, your outputs are ok. :wink:
"Everything should be made simple, but not always simpler"

anupam
A great helper
Posts: 405
Joined: Wed Aug 28, 2002 6:45 pm
Contact:

Post by anupam »

I think he corrector is ok now..
"Everything should be made simple, but not always simpler"

Post Reply

Return to “Volume 3 (300-399)”