Submit | All submissions | Best solutions | Back to list |
DIVSUM - Divisor Summation |
Given a natural number n (1 <= n <= 500000), please output the summation of all its proper divisors.
Definition: A proper divisor of a natural number is the divisor that is strictly less than the number.
e.g. number 20 has 5 proper divisors: 1, 2, 4, 5, 10, and the divisor summation is: 1 + 2 + 4 + 5 + 10 = 22.
Input
An integer stating the number of test cases (equal to about 200000), and that many lines follow, each containing one integer between 1 and 500000 inclusive.
Output
One integer each line: the divisor summation of the integer given respectively.
Example
Sample Input: 3 2 10 20 Sample Output: 1 8 22
Warning: large Input/Output data, be careful with certain languages
Added by: | Neal Zane |
Date: | 2004-06-10 |
Time limit: | 3s |
Source limit: | 5000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
Resource: | Neal Zane |
hide comments
|
||||||||||||||
2017-03-20 07:33:21
@az10 check it on spoj toolkit |
||||||||||||||
2017-03-12 23:22:05
easy one 0.34s. |
||||||||||||||
2017-01-22 22:24:17
where can we see the answers when we do not know the answer? |
||||||||||||||
2017-01-18 22:10:44
Nice question. |
||||||||||||||
2016-12-11 12:41:52
Very good question. AC in 3rd go!! |
||||||||||||||
2016-12-10 17:41:15
You should check if your solution works with square numbers, I got WA at first because of this |
||||||||||||||
2016-12-09 21:22:55
take care of n=1 |
||||||||||||||
2016-11-14 07:36:03
my 6th, and still getting WA. whyy?? :( |
||||||||||||||
2016-11-11 12:10:21
brute force 2.91s LOL!!!!!!!!!!! |
||||||||||||||
2016-10-25 15:58:19
is there any rule to write code....Because my code is working properly giving right outputs then only website says answer is wrong. |