inline char Makenumber(const int x) {
return x^48;
}
inline std::string Makenumber(int x) {
if (!x)
return "0";
static std::string s;
for (s = ""; x; x/=10)
s = Makenumber(x%10)+s;
return s;
}
此函数的时间复杂度应该是 O(k2) 的( k 为 x 的位数)
时间卡在关于字符串与字符的加法上了
求 O(k) 时间复杂度的的算法