BZOJ1968 [Ahoi2005]common Approximate study

Source: Internet
Author: User

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
Hintsource

Day2

Positive solution: Math Problem Solving Report:
It is possible to discuss the contribution of each factor.
1 //It's made by jump~2#include <iostream>3#include <cstdlib>4#include <cstring>5#include <cstdio>6#include <cmath>7#include <algorithm>8#include <ctime>9#include <vector>Ten#include <queue> One#include <map> A#include <Set> - using namespacestd; -typedefLong LongLL; the intN,ans; -  -InlineintGetint () - { +        intw=0, q=0;CharC=GetChar (); -         while((c<'0'|| C>'9') && c!='-') C=getchar ();if(c=='-') q=1, c=GetChar (); +         while(c>='0'&& c<='9') w=w*Ten+c-'0', C=getchar ();returnQ? -w:w; A } at  -InlinevoidWork () { -N=getint (); for(intI=1; i<=n;i++) ans+=n/i; printf"%d", ans); - } -  - intMain () in { - Work (); to   return 0; +}

BZOJ1968 [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.