80分求大佬调,被卡数据很无语
查看原帖
80分求大佬调,被卡数据很无语
578146
weisumouyingjinpai楼主2024/9/11 11:52
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<cstdlib>
#include<deque>
#include<bitset>
#include<set>
#include<map>
using namespace std;
int a,b,c;
bool op[11];
int ans=0;

namespace wsl
{
	inline void read()
	{
		 ios::sync_with_stdio(false);
		 cin.tie(0);cout.tie(0);
	}
	
	inline bool fen(int x)
	{
		int iu;
		iu=x%10;
		if(op[iu]) return false;
		op[iu]=1;
		x/=10;
		iu=x%10;
		if(op[iu]) return false;
		op[iu]=1;
		x/=10;
		iu=x%10;
		if(op[iu]) return false;
		op[iu]=1;		
		return true;
	}
	
	inline bool pan(int x,int y,int z)
	{
		memset(op,0,sizeof(op));
		if(fen(x)&&fen(y)&&fen(z)) return true;
		return false;
	}
	
}

using namespace wsl;
int main()
{
	read();
	cin>>a>>b>>c;
	for(int i=100;i<=999;++i)
	{
		for(int j=i;j<=999;++j)
		{
			for(int k=j;k<=999;++k)
			{
				int A=i*(b*c);
				int B=j*(a*c);
				int C=k*(a*b);
				if(pan(i,j,k))
				{
					 if(A==B)
					{
						if(A==C)
						{	
							if(B==C)
							{
								ans=1;
								cout<<i<<" "<<j<<" "<<k<<endl;
							} 
						} 
					}	
				}
				
			}
		}
	}
	if(!ans)
	{
		cout<<"No!!!"<<endl;
	}
	return 0;
}

2024/9/11 11:52
加载中...