# Judge 2-1 - prime factorization ## 故事背景 天天,20歲進到暨大,也已經過了7個年頭,在離開前有一件心願想要請大家幫忙完成。 天天 : 好多年前,我掉了一隻心愛的金魚,但他很聰明,要讓他回來,只有寫出他出的質因數分解才有辦法,吾已老矣,只寫得出地雷,年輕的你們可以讓我安心地離開暨大嗎? ## 輸入說明 輸入 n 代表要從(n * n)+(n-1 * n-1)+...+(1 * 1) ## 輸出說明 n運算後的總合 質因數分解的結果 ## 範例: input: 4 output: Sum is 30 (2^1) (3^1) (5^1) input: 374 output: Sum is 17507875 (5^3) (7^1) (11^1) (17^1) (107^1) input: 1800 output: Sum is 1945620300 (2^2) (3^1) (5^2) (13^1) (277^1) (1801^1) Hint 質數需產生陣列存放~
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up