結果

問題 No.888 約数の総和
ユーザー vjudge1
提出日時 2024-09-25 22:28:59
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 520 bytes
コンパイル時間 2,716 ms
コンパイル使用メモリ 244,048 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-25 22:29:07
合計ジャッジ時間 6,524 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 TLE * 1 -- * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100000
ll sum(ll n){
    ll ans=1;
    for(int i=2;i*i<=n;i++){
            ll sum=1;
            ll k=1;
        while(n%i==0){
            n/=i;
            k*=i;
            sum+=k;
        }
            ans*=sum;
    }
    if(n>1){
        ans*=(1+n);
    }
    return ans;
}
int main(){
	//freopen("stdin.inp","r",stdin);
	//freopen("stdout.out","w",stdout);

	//Your code here
    ll n;
    cin>>n;
    cout<<sum(n)<<endl;

	return 0;
}
0