![]() |
HomeWork20251117 |
aShort answer. otherwise there won't be part b. Given R, the function and , as said, are fast. So we can use the algorithm of the following part, which is fast too. Long answer. Given , the candidates of the pair population is only 1, so few to guess. bGiven . Starting guess the largest integer, then following steps.
In this naïve algorithm, the results from step 2 will have and the results from step 3 will have so they deem not the answer. So the correct answer shall be out in step 1 already. Overall, it is still polynomial time of the size of the digits
|
|