結果

問題 No.888 約数の総和
ユーザー ouoz1V
提出日時 2019-09-20 21:32:30
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 350 bytes
コンパイル時間 1,387 ms
コンパイル使用メモリ 158,632 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-09-14 16:32:13
合計ジャッジ時間 4,989 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 8 TLE * 1 -- * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

long long int n;
long long int sum=1;

void solve(){  
    cin>>n;
    for(int i=2; i*i<=n; i++){
        if(n%i==0){
            sum+=i;
            sum+=(n/i);
            //cout<<i<<" "<<n/i<<" "<<sum<<endl;
        }
    }
    sum+=n;
    cout<<sum<<endl;
}

int main(){
    solve();
    return 0;
}
0