結果
問題 |
No.888 約数の総和
|
ユーザー |
![]() |
提出日時 | 2020-07-24 15:48:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 497 bytes |
コンパイル時間 | 1,535 ms |
コンパイル使用メモリ | 174,432 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-25 06:45:42 |
合計ジャッジ時間 | 2,647 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 WA * 1 |
ソースコード
#include <bits/stdc++.h> using ll = long long; using namespace std; int main() { ll n; cin >> n; ll t{ n }, pf{ 2 }; map<ll, int> m; while (t >= pf * pf) { if (!(t % pf)) { ++m[pf]; t /= pf; } else { ++pf; } } ++m[t]; ll res{ 1 }; for (const auto& im : m) res *= (pow(im.first, im.second + 1) - 1) / (im.first - 1); cout << res << "\n"; return 0; }