結果
| 問題 |
No.888 約数の総和
|
| コンテスト | |
| ユーザー |
kpinkcat
|
| 提出日時 | 2023-08-22 17:16:34 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 11 ms / 2,000 ms |
| コード長 | 404 bytes |
| コンパイル時間 | 950 ms |
| コンパイル使用メモリ | 99,724 KB |
| 最終ジャッジ日時 | 2025-02-16 12:19:34 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
using namespace std;
int main()
{
long long n, sum1 = 0;
cin >> n;
int t = pow(n, 0.5);
for (long long i = 1; i <= t; i++){
if (!(n%i) && (i != n/i)) sum1 += (i + n/i);
else if (!(n%i))sum1 += i;
}
cout << sum1 << endl;
}
kpinkcat