結果

問題 No.888 約数の総和
ユーザー tatt61880
提出日時 2020-03-29 02:51:14
言語 Kuin
(KuinC++ v.2021.9.17)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 2,818 ms
コンパイル使用メモリ 147,940 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-16 10:27:48
合計ジャッジ時間 3,625 ms
ジャッジサーバーID
(参考情報)
judge2 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

var ans: int :: 1

func main()
	var n: int :: cui@input().toInt(&)
	var factors: []int :: math@primeFactors(n)
	var factNums: dict<int, int> :: #dict<int, int>
	for i(0, ^factors - 1)
		do factNums.add(factors[i], factNums.get(factors[i], &) + 1)
	end for
	func f(key: int, value: int, c: kuin@Class): bool
		do @ans :* (key ^ (value + 1) - 1) / (key - 1)
		ret true
	end func
	do factNums.forEach(f, null)
	do cui@print("\{@ans}\n")
end func
0