Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <algorithm>
- #include <cmath>
- #include <string>
- #include <vector>
- #include <map>
- #include <set>
- //#include "BigInt.h"
- using namespace std;
- #define ll long long
- #define ull unsigned long long
- const ll INF = 999999999999999999;
- const double PI = acos(-1.0);
- void stop()
- {
- #ifndef ONLINE_JUDGE
- system("pause");
- #endif
- exit(0);
- }
- int main()
- {
- //freopen(".in", "r", stdin);
- //freopen(".out", "w", stdout);
- ios::sync_with_stdio(false);
- ll n;
- cin >> n;
- ll res = 0;
- for (ll i = 1; i*i <= n; i++)
- {
- res += n / i;
- }
- res *= 2;
- res -= (ll)sqrt(n)*(ll)sqrt(n);
- cout << res;
- stop();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement