結果

問題 No.888 約数の総和
ユーザー leaf_1415leaf_1415
提出日時 2019-09-20 21:26:42
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 514 bytes
コンパイル時間 1,257 ms
コンパイル使用メモリ 67,920 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-12 17:47:47
合計ジャッジ時間 2,613 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
4,348 KB
testcase_01 AC 12 ms
4,348 KB
testcase_02 AC 12 ms
4,352 KB
testcase_03 AC 12 ms
4,348 KB
testcase_04 AC 12 ms
4,348 KB
testcase_05 AC 12 ms
4,352 KB
testcase_06 AC 12 ms
4,352 KB
testcase_07 AC 12 ms
4,352 KB
testcase_08 AC 12 ms
4,352 KB
testcase_09 AC 12 ms
4,348 KB
testcase_10 AC 12 ms
4,352 KB
testcase_11 AC 13 ms
4,348 KB
testcase_12 AC 12 ms
4,352 KB
testcase_13 AC 12 ms
4,356 KB
testcase_14 AC 12 ms
4,352 KB
testcase_15 AC 12 ms
4,348 KB
testcase_16 AC 12 ms
4,356 KB
testcase_17 AC 12 ms
4,352 KB
testcase_18 AC 12 ms
4,352 KB
testcase_19 AC 12 ms
4,348 KB
testcase_20 AC 12 ms
4,348 KB
testcase_21 AC 12 ms
4,352 KB
testcase_22 AC 12 ms
4,348 KB
testcase_23 AC 12 ms
4,348 KB
testcase_24 AC 12 ms
4,352 KB
testcase_25 AC 12 ms
4,348 KB
testcase_26 AC 12 ms
4,356 KB
testcase_27 AC 12 ms
4,356 KB
testcase_28 AC 12 ms
4,348 KB
testcase_29 AC 12 ms
4,352 KB
testcase_30 AC 12 ms
4,348 KB
testcase_31 AC 12 ms
4,352 KB
testcase_32 AC 12 ms
4,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
#define llint long long

using namespace std;

llint n;
map<llint, llint> mp;

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n;
	for(int i = 2; i <= 1000000; i++){
		while(n % i == 0){
			mp[i]++;
			n /= i;
		}
	}
	if(n > 1) mp[n]++;
	
	llint ans = 1;
	for(auto it = mp.begin(); it != mp.end(); it++){
		llint sum = 0, mul = 1;
		for(int i = 0; i <= it->second; i++){
			sum += mul, mul *= it->first;
		}
		ans *= sum;
	}
	cout << ans << endl;
	
	return 0;
}
0