黑箱多项式(非负整数系数)需测几点可恢复全部系数
find the values of all the coefficients
题目详情
有一个黑箱多项式 ,其系数都满足 (非负整数)。你可以在任意给定点查询 的值。
最少需要查询多少个点,才能确定全部系数?
We consider a polynomial which all coefficients are positive . The polynomial is in a black box and we can only retrieve its value in given points. In how many points do we need to value the polynomial in order to find the values of all the coefficients?
解析
最少需要 个点。
构造方法:
- 查询 ,得到
于是每个系数都满足 。
- 再查询 。因为基数 严格大于每个“数字” ,所以
就是该整数在 进制下的唯一展开,其各位数字恰好是 。
因此两次查询即可恢复所有系数。