题目链接http://codeforces.com/contest/1249/problem/C2.这是道进制转换题,我们的目的是找到最小的一个每个位都是1的三进制数来表示一个十进制数n.做法是,先将n转换为一个三进制数,然后对当前位加上低位的进位大于等于2的位置0并进位,这一步需要注意的是,当前位如果产生进位,需要把该位的低位都给置0,这样才能保证重构后的数最小. 此外,需要注意的是,在利用重构数组计算10进制数的时候,不能用pow函数,因为,pow对3的38次幂是无法计算的,会发生溢出,需要…