結果

問題 No.888 約数の総和
ユーザー sigmanisigmani
提出日時 2022-02-17 19:58:49
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 243 bytes
コンパイル時間 1,561 ms
コンパイル使用メモリ 166,652 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-29 07:46:35
合計ジャッジ時間 2,535 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 3 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
 long long N;
 cin>>N;
 long long D=sqrt(N);
 long long answer=0;
 for(int i=1;i<=D;i++){
   if(N%i==0){
     if(i!=N/i)answer=i+N/i;
     else answer=answer+i;
   }
 }
cout<<answer;

}
0