1968: [Ahoi2005]common approximate study

Source: Internet
Author: User

1968: [Ahoi2005]common Approximate study time limit:1 Sec Memory limit:64 MB
submit:1127 solved:852
[Submit] [Status] [Discuss] Descriptioninput only one line of an integer N (0 < N < 1000000). Output has only one row of outputs, the sum of integers m, or f (1) to F (N). Sample Input3
Sample Output5
HINT Source

Day2

Puzzle: A god problem (hansbug: In fact, the first to see someone else's AC code hundreds of B a bit frightened), in fact, we can reverse thinking about this problem, do not always think of the primary school to learn the number of numbers in the number of the formula, it will only cause chaos, Just consider the extent to which the various approximations contribute to the answer, i.e. [n/i] (set approximate to I), then no, it can be used as a water question = =

1/**************************************************************2Problem:19683 User:hansbug4 language:pascal5 result:accepted6Time: theMs7Memory: -KB8****************************************************************/9  Ten varN,m,ans:int64; One begin AREADLN (n); m:=n;ans:=0; -       whileM>0  Do -            begin theInc (Ans,nDivm); - Dec (m); -            End; - writeln (ans); + Readln; - End.

1968: [Ahoi2005]common approximate study

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.