10736 - Series of PI

All about problems in Volume 107. 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
Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

10736 - Series of PI

Post by Observer »

I'm trying something with logarithms. I can get the sample i/o right, but still WA. Could anyone please tell me the correct output for the following test cases?
1
2
3
4
5
6
7
8
9
10
132641
245630
270863
284590
341722
346863
400320
416796
440342
468855
509756
563455
599997
599998
599999
600000
-2
Thanks in advance. :)

( Or is my idea totally wrong? :wink: )
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
david
Learning poster
Posts: 83
Joined: Mon Apr 21, 2003 10:14 pm

Post by david »

My program outputs

2
3
4
5
7
8
10
11
13
14
220299
407969
449880
472680
567574
576113
664903
692269
731378
778737
846672
935864
996559
996561
996562
996564

(and yes, the key idea is to take logarithms)
Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Post by Observer »

Thanks a lot! AC now. :P

P.S. I've made a really silly mistake in my old code...... :wink:
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
Sedefcho
A great helper
Posts: 374
Joined: Sun Jan 16, 2005 10:18 pm
Location: Bulgaria

Post by Sedefcho »

The pictures are not visible on the main page of that problem.
I mean they are not visible on
http://acm.uva.es/p/v107/10736.html

Where can we find the pictures which are part of the
problem statement of problem 10736 ?
Cho
A great helper
Posts: 274
Joined: Wed Oct 20, 2004 11:51 pm
Location: Hong Kong

Post by Cho »

Image
Image
Image
Image

or view the pdf file
Sedefcho
A great helper
Posts: 374
Joined: Sun Jan 16, 2005 10:18 pm
Location: Bulgaria

Post by Sedefcho »

Tnanks, Cho!

I forgot there's always a PDF file :)
Stupid, I know. Anyway, I got ACC already.

It is really strange that the pictures are not
visible because they are present on the site
and also seems to me the links to them in the file in 10736.html
are also OK. Check these URLs:
http://acm.uva.es/p/v107/p10736a.gif
http://acm.uva.es/p/v107/p10736b.gif
http://acm.uva.es/p/v107/p10736c.gif
http://acm.uva.es/p/v107/p10736d.gif

One more important thing - my ACC program outputs
for N = 7 the answer 9 and not 10
as the ACC program from david ?!
All other answers of my program are same as his answers
( I mean if we use the input from Observer ).

That's just a notice to the future readers of david's sample output
for the input which Observer has posted.

And one last thing - here is another view to the series we
are dealing with. I think it makes it obvious what the formula for
the N-th term is. See below:
Image

Good luck to everyone.
david
Learning poster
Posts: 83
Joined: Mon Apr 21, 2003 10:14 pm

Post by david »

Sedefcho wrote: One more important thing - my ACC program outputs
for N = 7 the answer 9 and not 10
as the ACC program from david ?!
All other answers of my program are same as his answers
( I mean if we use the input from Observer ).
The 10th term of the taylor expansion for arcsin(x) is 12155/1245184*x^19,
and the 11th one is 46189/5505024*x^21,
You can check that the 10th term of the final series is about 6435/557056*(1/2)^17 * 6 = 1.117e-7 > 1e-7, so the answer can't be 9.
The 11th term is the first one to become less than 1e-7, so I guess you're lucky your program passed the test data.
Post Reply

Return to “Volume 107 (10700-10799)”