Bzoj 1968: [Ahoi2005]common approximate study

Source: Internet
Author: User

1968: [Ahoi2005]common Approximate study time limit:1 Sec Memory limit:64 MB
submit:2032 solved:1537
[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

[Submit] [Status] [Discuss]

Retarded I see the range of n is like the linear Euler function, hopeless ...

You only need to enumerate each number in 1 to N, and calculate the approximate number of numbers within a few ranges.

1#include <bits/stdc++.h>2 3Signed Main (void)4 {5     intN scanf"%d", &n);6     Long LongAns =0;7      for(inti =1; I <= N; ++i)8Ans + = n/i;9printf"%lld\n", ans);Ten}

@Author: Yousiki

Bzoj 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.