10907 - Art Gallery

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

Moderator: Board moderators

kp
Learning poster
Posts: 71
Joined: Tue Apr 26, 2005 1:29 am
Location: Russia

Post by kp » Sat Oct 01, 2005 4:44 pm

misof wrote:
kp wrote:I see...

Does anybody know how to use
such routines as printf("%.2f") in PASCAL?

I believe Format() is restricted ?!
var x : double;
x := 1.2345;
writeln(x:0:2); { 0 is the total # of chars (if non-zero, aligns right), 2 is the # of decimal places }
Thanks, but that's exactly what I'am doing...

BTW, I figured out one more thing. Code:

x:= 130.125;
writeln(x:0:2);

gives 130.13 if compiled with Delphi (my native compiler)
but gives 130.12 if compiled with FreePascal

So, what I see is not what I get :)

Will try to get AC...

kp
Learning poster
Posts: 71
Joined: Tue Apr 26, 2005 1:29 am
Location: Russia

Post by kp » Sat Oct 01, 2005 5:49 pm

FINALLY... :)

Thanks to misof, Cho and little joey.

My mistake was pretty stuppid:
while reading vertexes of polygon I assumed
that some of them might be on one line and
tried to delete useless vertexes "on the fly", but I did it not properly.

User avatar
ImLazy
Experienced poster
Posts: 215
Joined: Sat Jul 10, 2004 4:31 pm
Location: Shanghai, China

Post by ImLazy » Tue Oct 04, 2005 8:46 am

My output for Cho's test data (I just talk about the valid ones in his test input) is a little different with Misof's, some of them are 0.01 more than Misof's. Maybe my algorithm loses precision. But still I get AC. This means the test input of the online judge is not very strict in precision, I think.
I stay home. Don't call me out.

shanto86
Experienced poster
Posts: 160
Joined: Wed Jul 30, 2003 8:10 pm

Post by shanto86 » Tue Jun 06, 2006 2:45 pm

I can't find mistake in this code. can anyone please help?

Code: Select all

 REMOVED 
Last edited by shanto86 on Tue Jun 06, 2006 2:47 pm, edited 1 time in total.
Self judging is the best judging!

shanto86
Experienced poster
Posts: 160
Joined: Wed Jul 30, 2003 8:10 pm

Post by shanto86 » Tue Jun 06, 2006 2:46 pm

I think it is too strange! i don't know what i changed but it got AC! :evil:
Self judging is the best judging!

DJWS
Learning poster
Posts: 100
Joined: Sat Oct 11, 2003 3:30 pm
Location: Taiwan
Contact:

Post by DJWS » Tue Aug 22, 2006 1:50 pm

Thanks to pervious people. :D
Test data you supply are very useful.

Here is test case #27 you metioned:

Code: Select all

9
18 2
19 18
14 19
6 19
3 18
2 7
2 6
15 2
7 1
1
3 6
Here is output:

Code: Select all

Gallery #1
244.82
I made mistake about array manipulation. (I just forgot to mod N somewhere)
This test data should verify that.
Hope this helps. :D
--
DJWS, a newbie in programming :wink:

User avatar
hank
Experienced poster
Posts: 146
Joined: Mon Feb 04, 2002 2:00 am
Location: VCORE.

Post by hank » Tue Sep 19, 2006 11:33 am

ImLazy wrote:My output for Cho's test data (I just talk about the valid ones in his test input) is a little different with Misof's, some of them are 0.01 more than Misof's. Maybe my algorithm loses precision. But still I get AC. This means the test input of the online judge is not very strict in precision, I think.
Yes. My output for Cho's test data is also a little different.
But i got AC too.

Anindya
New poster
Posts: 28
Joined: Sun Feb 04, 2007 4:34 am
Location: EEE,BUET,DHAKA

Post by Anindya » Sat Mar 08, 2008 7:41 am

Can anybody help me on this problem?
I have tried every i/o posted in this forum & passed them all.
I can't find any error in my codes.
Can any one give me some test cases?

Post Reply

Return to “Volume 109 (10900-10999)”