Original Question: Small G and Calculation Questions

Small G and calculation problems

(calc.c / cpp)

topic background

sxd is going to AK again. So, Little G wanted to nai him:

So, sxd got angry.

sxd: Since you are worse than me in math, you are not qualified to nai me! ! !

sxd wants to compare computing power with you

sxd thought that he was not worthy of such a stupid calculation problem, so he asked LGX to come up with one.

As a good friend of Little G, as long as your program can complete this question within 1s, Little G can successfully continue to nai SXD with legitimate reasons. Of course, Little G will also give you 100 points as a reward.

Topic description

This calculation is divided into three steps

  1. Define \(a\$b=((((a^a)^a)^a)^{\cdots})^a\) , there are a total of \(b\) \( a \) ( Note that it is "total", the base is also counted as one, if you still don't understand, just look at the example), calculate the value of \(a\$b\) , the answer is modulo \(1e9+7\) , the answer is recorded is \(ans_1\) .
  2. Define the function \(f:N_+\to N\) : \(f(1)=0\) , and for any \(n\in N_+\) , \(n\ge 2\) , there are \ [f(n)=\max\{f(j)+f(nj)+j\mid j=1,2,3,\cdots,\lfloor \frac{n}{2}\rfloor\}.\ ] Find the value of \(f(c)\) , the answer is modulo \(1e9+7\) , and the answer is recorded as \(ans_2\) .

  3. Calculate the value of \(C^{\min\{ans_1,ans_2\}}_{max\{ans_1,ans_2\}}\) , and the answer is modulo \(9007\) .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324617012&siteId=291194637