結果

問題 No.888 約数の総和
ユーザー anhkhoa Leanhkhoa Le
提出日時 2020-06-19 17:57:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 571 bytes
コンパイル時間 1,436 ms
コンパイル使用メモリ 165,044 KB
実行使用メモリ 11,320 KB
最終ジャッジ日時 2023-09-16 12:59:14
合計ジャッジ時間 4,425 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
long long n,i,d[1000001],s,j;
long long lt(long long m, long long n)
{
    if(n==0) return 1;
    if(n==1) return m;
    long long  d=lt(m,n/2);
    if(n%2==0) return (d*d);
    else return d*d*m;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin>>n;
    s=1;
    i=2;
    while(i<=sqrt(n)||n!=1)
    {
        if(n%i==0)
        {
            d[i]++;
            n=n/i;
        }
        if(n%i!=0)
        {
            s=s*((lt(i,d[i]+1)-1)/(i-1));
            i++;
            d[i]=0;
        }
    }
    cout<<s;
}
0