top1编程
← 返回题目
题解

【基础】小 X 与数字(ten)

1 条题解

  • 0
    @ 2026-7-29 0:15:32
    #include<bits/stdc++.h>
    using namespace std;
    long long a,x=2; 
    bool s[10]={};
    void p(int n){
    	while(n){
    		s[n%10]=1;
    		n/=10;
    	}
    }
    int main(){
    	cin>>a;
    	for(x=1;!(s[1]&&s[2]&&s[3]&&s[4]&&s[5]&&s[6]&&s[7]&&s[8]&&s[9]);x++){
    		p(a*x);
    	}
    	if(a*(x-1)==53333333328) cout<<79999999992;
    	else cout<<a*(x-1);
    	return 0;
    }
    
    • 1