D. Fun with Integers
题意
You are given a positive integer n greater or equal to 2. For every pair of integers a and b (2≤|𝑎|,|𝑏|≤𝑛2≤|a|,|b|≤n), you can transform a into b if and only if there exists an integer x such that 1<|x| and (a⋅x=b or b⋅x=a), where |x| denotes the absolute value of x.
After such a transformation, your score increases by |x| points and you are not allowed to transform a into b nor b into a anymore.
Initially, you have a score of 0. You can start at any integer and transform it as many times as you like. What is the maximum score you can achieve?
题解
答案为 2~n 每个数的因子( 范围为$[2,n)$ )之和。
代码
1 |
|