結果

問題 No.888 約数の総和
ユーザー toto6114
提出日時 2019-09-20 22:35:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 317 bytes
コンパイル時間 882 ms
コンパイル使用メモリ 79,896 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-14 18:31:34
合計ジャッジ時間 1,983 ms
ジャッジサーバーID
(参考情報)
judge6 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
int main() {
  long long n,ans=0,i;
  cin >> n;
  if(n==1) {
    cout << 1 << endl;
    return 0;
  }
  for(i=1; i*i<=n; i++) {
    if(n%i==0) {
      ans+=i;
      ans+=n/i;
    }
  }
  cout << ans << endl;
}
0