Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- #include <ext/pb_ds/assoc_container.hpp>
- using namespace __gnu_pbds;
- typedef tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
- #define suni ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
- #define endl "\n"
- #define mn int main()
- #define frac() cout.unsetf(ios::floatfield);cout.precision(6);cout.setf(ios::fixed,ios::floatfield);
- const int mx=1e7+123;
- int a[mx];
- mn
- {
- suni;
- int n;
- cin>>n;
- for(int i=1;i<=n;i++)
- {
- for(int j=i;j<=n;j+=i)
- a[j]++;
- }
- ll ans=0;
- for(int i=1;i<=n;i++)
- ans+=( 1LL*i*a[i]);
- cout<<ans<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement