結果
問題 | No.888 約数の総和 |
ユーザー |
|
提出日時 | 2020-04-10 16:55:34 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 16 ms / 2,000 ms |
コード長 | 413 bytes |
コンパイル時間 | 709 ms |
コンパイル使用メモリ | 66,048 KB |
最終ジャッジ日時 | 2025-01-09 15:41:37 |
ジャッジサーバーID (参考情報) |
judge3 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <iostream>using lint = long long;void solve() {lint n;std::cin >> n;lint ans = 0;for (lint p = 1; p * p <= n; ++p) {if (n % p != 0) continue;ans += p;if (n / p == p) continue;ans += n / p;}std::cout << ans << std::endl;}int main() {std::cin.tie(nullptr);std::ios::sync_with_stdio(false);solve();return 0;}