結果
問題 | No.888 約数の総和 |
ユーザー |
![]() |
提出日時 | 2020-05-17 04:14:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 15 ms / 2,000 ms |
コード長 | 305 bytes |
コンパイル時間 | 2,151 ms |
コンパイル使用メモリ | 192,496 KB |
最終ジャッジ日時 | 2025-01-10 12:39:49 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(0);int64_t N;cin >> N;int64_t res = 0;for (int64_t p = 1; p * p < N + 1; p++) {if (N % p == 0) res += p + (N / p);if (p * p == N) res -= p;}cout << res << '\n';return 0;}