Language: C++

/**
 *   Author:  Wasi Ur Rahman
 *   FROM RMSTU
**/
#include <bits/stdc++.h>
#define ll         			unsigned long long int
#define boost       		ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define min3(a,b,c)    		min(a,min(b,c))
#define min4(a,b,c,d)  		min(d,min3(a,b,c))
#define max3(a,b,c)    		max(a,max(b,c))
#define max4(a,b,c,d)  		max(d,max3(a,b,c))
#define all(v)         		v.begin(),v.end()
#define revall(v)      		v.rbegin(),v.rend()
#define pb             		push_back
#define eb             		emplace_back
#define setbits(x)     		__builtin_popcountll(x)
#define zrobits(x)     		__builtin_ctzll(x)
#define si(x)               scanf("%d", &x)
#define sii(x, y)           scanf("%d %d", &x, &y)
#define siii(x, y, z)       scanf("%d %d %d", &x, &y, &z)
#define siiii(p,x, y, z)    scanf("%d %d %d %d",&p, &x, &y, &z)
#define sll(x, y)           scanf("%lld %lld", &x, &y)
#define slll(x, y, z)       scanf("%lld %lld %lld", &x, &y, &z)
#define read                freopen("input.txt","r",stdin)
#define write               freopen("output.txt","w",stdout)
#define println()           cout << endl
#define printi(x)           printf("%d\n")
#define printii(x,y)        printf("%d %d\n")
#define printiii(x,y,z)     printf("%d %d %d\n")
#define printl(x)           printf("%lld\n")
#define printll(x,y)        printf("%lld %lld\n")
#define printlll(x,y,z)     printf("%lld %lld %lld\n") 
using namespace std;
/*************************************
**          A S S E M B L E         **
**************************************/
bool isPrime(ll n){if(n <= 1)return false;for (ll i = 2; i * i < n; i++)if (n % i == 0)return false;return true;}
ll fact(ll n){ll res = 1;for(ll i = n;i>=1;i--)res *= i;return res;}
ll nCr(ll n,ll r){return (fact(n)/(fact(r)*fact(n-r)));}
ll nPr(ll n,ll r){return fact(n)/fact(n-r);}
ll modpow(ll a, ll n, ll mod){ll res=1;while(n>0){if(n&1) res=res*a%mod;a=a*a%mod;n>>=1;}return res;}
const int mod=838627288460105;
inline int add(int a,int b){if((a+=b)>=mod)a-=mod;return a;}
inline int dec(int a,int b){if((a-=b)<0)a+=mod;return a;}
inline int mult(int a,int b){long long t=1ll*a*b;if(t>=mod)t%=mod;return t;}
inline int power(int a,int b){int out=1;while(b){if(b&1)out=mult(out,a);a=mult(a,a);b>>=1;}return out;}
bitset<838627288460105> bs;
vector<ll> primes;

void sieve(long long upper_bound) {
    primes.erase(primes.begin(), primes.end());
    bs.set();
    bs[0] = bs[1] = 0;
    primes.push_back(2);
    for(long long i = 3; i <= upper_bound + 1; i += 2) {
        if(bs[i]) {
            for(long long j = i * i; j <= upper_bound + 1; j += 2*i)
                bs[j] = 0;
            primes.push_back((int) i);
        }
    }
}
ll countDivisor2(ll n) {
    if (n < 1) return 0;
    ll sqrn = (ll) sqrt(n);
    sieve(n+1);
    ll divisor = 1;
    for (ll i = 0; primes[i]*primes[i] <= n; i++) {
        if (n % primes[i] == 0) {
           ll cnt = 1;
            while (n % primes[i] == 0) {
                n /= primes[i];
                cnt++;
            }
            divisor *= cnt;
        }
    }
    if (n > 1) divisor *= 2;
    return divisor;
}

ll countDivisor1(ll n) {
    ll divisor = 0;
    for (ll i = 1; i * i <= n; i++) {
        if (i * i == n) {
            divisor += 1;
        } else if (n % i == 0) {
            divisor += 2;
        }
    }
    return divisor;
}
long long mulmod(long long a, 
                            long long b, 
                            long long mod) 
{ 
    long long res = 0; // Initialize result 
  
    // Update a if it is more than 
    // or equal to mod 
    a %= mod; 
  
    while (b) 
    { 
        // If b is odd, add a with result 
        if (b & 1) 
            res = (res + a) % mod; 
  
        // Here we assume that doing 2*a 
        // doesn't cause overflow 
        a = (2 * a) % mod; 
  
        b >>= 1; // b = b / 2 
    } 
  
    return res; 
}

/*************************************
**  E N D    G A M E   S T A R T S  **
**************************************/
int main(){
	boost;
	ll t;
	cin >> t;
	ll sum = 0;
	for(ll i = t;i>=1;i--){
		sum += mulmod(i,countDivisor1(i),mod);
	}
	cout << sum << endl;
}



Compiler output:
a.cc:42:15: warning: overflow in conversion from 'long int' to 'int' changes value from '838627288460105' to '564177737' [-Woverflow]
   42 | const int mod=838627288460105;
      |               ^~~~~~~~~~~~~~~
/tmp/ccgQBHpc.o: in function `sieve(long long)':
a.cc:(.text+0x1aa): relocation truncated to fit: R_X86_64_PC32 against symbol `primes' defined in .bss section in /tmp/ccgQBHpc.o
a.cc:(.text+0x1d9): relocation truncated to fit: R_X86_64_PC32 against symbol `primes' defined in .bss section in /tmp/ccgQBHpc.o
a.cc:(.text+0x219): relocation truncated to fit: R_X86_64_PC32 against symbol `primes' defined in .bss section in /tmp/ccgQBHpc.o
a.cc:(.text+0x2b7): relocation truncated to fit: R_X86_64_PC32 against symbol `primes' defined in .bss section in /tmp/ccgQBHpc.o
a.cc:(.text+0x381): relocation truncated to fit: R_X86_64_PC32 against symbol `primes' defined in .bss section in /tmp/ccgQBHpc.o
/tmp/ccgQBHpc.o: in function `countDivisor2(unsigned long long)':
a.cc:(.text+0x448): relocation truncated to fit: R_X86_64_PC32 against symbol `primes' defined in .bss section in /tmp/ccgQBHpc.o
a.cc:(.text+0x487): relocation truncated to fit: R_X86_64_PC32 against symbol `primes' defined in .bss section in /tmp/ccgQBHpc.o
a.cc:(.text+0x4b5): relocation truncated to fit: R_X86_64_PC32 against symbol `primes' defined in .bss section in /tmp/ccgQBHpc.o
a.cc:(.text+0x4fc): relocation truncated to fit: R_X86_64_PC32 against symbol `primes' defined in .bss section in /tmp/ccgQBHpc.o
a.cc:(.text+0x515): relocation truncated to fit: R_X86_64_PC32 against symbol `primes' defined in .bss section in /tmp/ccgQBHpc.o
/tmp/ccgQBHpc.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x6e4): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status