結果

問題 No.888 約数の総和
ユーザー ouoz1Vouoz1V
提出日時 2019-09-20 21:32:30
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 350 bytes
コンパイル時間 1,958 ms
コンパイル使用メモリ 143,628 KB
実行使用メモリ 8,700 KB
最終ジャッジ日時 2023-10-12 18:02:43
合計ジャッジ時間 5,212 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,700 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,348 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,352 KB
testcase_10 WA -
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1 ms
4,352 KB
testcase_17 WA -
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

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