题解分享
题解分享简介
进制(结果填空) - 题解
0技巧,纯暴力
```
#include<bits/stdc++.h>
using namespace std;
bool func(int x)
{
long long num = 8100178706957568;
while(num)
{
if(num % x < 10)
{
num /= x;
}
else
{
return false;
}
}
return true;
}
int main()
{
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);//取消同步流,让C++代码更快
for(int i = 11;i <= 36;i++)
{
if(func(i))
{
cout<<i<<endl;
break;
}
}
return 0;
}
```
查看全文
0
0
1
3
进制(结果填空) - 题解
```
#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> pii;
int s=8100178706957568;
int check(int x)
{
int ss=s;
while(ss)
{
if(ss%x>=10) return 0;
ss/=x;
}
return 1;
}
void solve()
{
for(int i=11;i<=36;i++)
{
if(check(i))
{
cout<<i;
}
}
}
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
t=1;
// cin>>t;
while(t--)
{
solve();
}
return 0;
}
```
查看全文
0
0
0
2



