1
2023-07-17 10:23:51
发布于:浙江
14阅读
0回复
0点赞
#include<iostream>
using namespace std;
bool valid(long long n){
int a[10]={0,0,0,0,0,0,0,0,0,0};
if(n<10000000){
a[0];
}
for(;n>0;n/=10){
a[n%10];
if(a[n%10]>1){
return false;
}
}
return true;
}
int main(){
long long n;
int c=0;
cin>>n;
long long p = 9876543;
long long left = n/10000000;
c += left * p;
for(long long i=left * 10000000;i<=n;i++){
long long first, second, third;
first = i/10000000;
second = (i - first * 10000000)/1000000;
if(first == second) {
i += 999999;
continue;
}
if(!valid(i)){
continue;
}
c++;
}
cout<<c;
}
这里空空如也
有帮助,赞一个