有一个RE样例过了。求大佬们调!!求求了
查看原帖
有一个RE样例过了。求大佬们调!!求求了
1202457
sunny2014楼主2024/3/27 21:02
#include<bits/stdc++.h>
using namespace std;
int b[15];
void g(int x){
	b[x%10] = 1;
	b[x/10%10] = 1;
	b[x/100] = 1;
}
bool ch(int x,int y,int z){
	memset(b,0,sizeof(b));
	if(y>999||z>999) return 0;
	g(x);
	g(y);
	g(z);
	for(int i=1;i<=9;i++){
		if(!b[i]) return 0;
	}
	return 1;
}
int main(){
	long long A,B,C,x,y,z,t=0;
	cin>>A>>B>>C;
	for(x=123;x<=987;x++){
		if(x*B%A||x*C%A) continue;
		y = x*B/A;
		z = x*C/A;
		if(ch(x,y,z)){
			printf("%lld %lld %lld\n",x,y,z);
			t++;
		}
	}
	if(!t) cout<<"No!!!"; 
	return 0;
}
2024/3/27 21:02
加载中...