結果

問題 No.888 約数の総和
ユーザー kpinkcat
提出日時 2023-08-22 17:13:16
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 439 bytes
コンパイル時間 989 ms
コンパイル使用メモリ 100,284 KB
最終ジャッジ日時 2025-02-16 12:19:25
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
using namespace std;


int main()
{
    long long n, sum1 = 0;
    cin >> n;
    if (n == 1){
        cout << 1 << endl;
    }
    for (long long i = 1; i <= pow(n, 0.5); i++){
        if (!(n%i) && (i != n/i)) sum1 += (i + n/i);
        else if (!(n%i))sum1 += i;
    }
    cout << sum1 << endl;
}
0