結果
| 問題 |
No.888 約数の総和
|
| コンテスト | |
| ユーザー |
a
|
| 提出日時 | 2019-09-20 21:46:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 478 bytes |
| コンパイル時間 | 1,681 ms |
| コンパイル使用メモリ | 166,604 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-14 17:08:33 |
| 合計ジャッジ時間 | 2,780 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 18 WA * 12 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
void solve()
{
long n;
cin >> n;
long ans = 1;
for (long f = 2; f * f <= n; f++)
{
if (n % f != 0)
{
continue;
}
long res = 1;
while (n % f == 0)
{
n /= f;
res = res * f + 1;
}
ans *= res;
}
if (n > 1)
{
ans += n;
}
cout << ans << endl;
}
int main()
{
solve();
return 0;
}
a