
解题思路
按照题意进行模拟,计算 x x x 的 b b b 进制过程中,若出现余数大于 9 9 9,则说明 x x x 的 b b b 进制一定要用字母进行表示。
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
using namespace std;
typedef long long LL;
LL x = 8100178706957568;
bool check(LL x, int b)
{
while (x)
{
if (x % b >= 10)
return false;
x /= b;
}
return true;
}
int main()
{
for (int i = 11; i <= 36; ++ i )
if (check(x, i))
cout << i << endl;
return 0;
}
运行结果:
32
【在线测评】

















![[Algorithm][前缀和][和为K的子数组][和可被K整除的子数组][连续数组][矩阵区域和]详细讲解](https://img-blog.csdnimg.cn/direct/62502bb9feed47ea98b3674669cc7d45.png)
