Problem Description
Loading...
Problem Analysis
It involves computing divisors.
To reduce the number of operations,
an array is used to record the sum of divisors of each number.
Then, since each pair should be printed only once,
and the later number is larger than the earlier one,
the inner loop can start from i,
there is no need to start from 1.
cpp
| |
Problem link: 【DidaOJ】[491]【C Language Training】Amicable Numbers