4 条题解

  • 1
    @ 2022-7-11 9:46:13

    //dev c++[[990.cpp]]*******

    //dev c++[top fanil]]******

    //dev c++*www.temege.com

    #include <stdio.h>

    #include <iostream>

    #include <math.h>

    #include <queue>

    #include <stack>

    #include <vector>

    #include <iomanip>

    #include <string.h>

    #include <algorithm>

    using namespace std;

    #define LL long long const int N=1e6+10;

    const int INF=0x3f3f3f3f;

    int num[15];

    int main()

    {

    int a,b,c;
    
    cin>>a>>b>>c;
    
    int p=1;
    
    
    for(int i=100;i<=1000;i++)
    {
    
    
    	int x,y,z;
    
    	x=i;
        
    	y=i*b/a;
    
    
    	z=i*c/a;
    
    	if(x>1000||y>1000||z>1000)
    	{
    
    		continue;
    
    	}
    
    	memset(num,0,sizeof(num));
    
    
    	while(x)
    	{
    
    		num[x%10]++;
    
    		x/=10;
    
    	}
    
    	x=z;
    
    	while(x)
    
    	{
    
    		num[x%10]++;
    
    		x/=10;
    
    	}
    
    	int flag=1;
    
    	for(int j=1;j<=9;j++)
    
    	{
    
    		if(num[j]!=1)
    
    		{
    			flag=0;
    
    			break;
    
    		}
    
    	}
    
    
    	if(flag==1)
    	{
    
    		p=0;
    
    		cout<<i<<" "<<y<<" "<<z<<endl;
    
    	}
    
    }
    
    if(p)
    
    
    {
    	puts("No!!!");
    
    }
    
    return 0;
    

    }

    • 1
      @ 2022-7-11 9:43:53

      #include<stdio.h> #include<iostream> #include<string.h> using namespace std; const int N=2e6+10; const int INF=0x3f3f3f3f; int num[15]; int main() { int a,b,c; cin>>a>>b>>c; int p=1; for(int i=100;i<=1000;i++) { int x,y,z; x=i; y=ib/a; z=ic/a; if(x>1000||y>1000||z>1000) continue; memset(num,0,sizeof(num)); while(x) { num[x%10]++; x/=10; } x=y; while(x) { num[x%10]++; x/=10; } x=z; while(x) { num[x%10]++; x/=10; } int flag=1; for(int j=1;j<=9;j++) { if(num[j]!=1) { flag=0; break; } } if(flag==1) { p=0; cout<<i<<" "<<y<<" "<<z<<endl; } } if(p) puts("No!!!"); return 0; }

      • 0
        @ 2023-3-11 11:32:44
        #include<iostream>
        #include<iomanip>
        #include<stdio.h>
        #include<math.h>
        #include<string>
        #include<string.h>
        #include<sstream>
        #include<algorithm>
        using namespace std;
        int a,b,c,x,y,z,n[10],s=1,js;
        void cx(int m){
        	while(m){
        		n[m%10]=1;
        		m/=10;
        	}
        }
        int main(){
        	cin>>a>>b>>c;
        	for(int i=1;i<=1000;i++){
        		x=i;
        		y=i*b/a;
        		z=i*c/a;
        		if(z<1000){
        			cx(x);
        			cx(y);
        			cx(z);
        			js=0;
        			for(int j=1;j<=9;j++)if(n[j]!=1)js=1;
        			if(js==0){
        				s=0;
        				printf("%d %d %d\n",x,y,z);
        			}
        			memset(n,0,sizeof(n));
        		}
        	}
        	if(s)cout<<"No!!!";
        	return 0;
        }
        
        • 0
          @ 2022-7-11 9:51:31

          /crl(陈儒乐)/

          #include<bits/stdc++.h>//网上查到的万能头//
          
          #include <queue>
          
          #include <math.h>
          
          #include <stack>
          
          #include <stdio.h>
          
          #include <iostream>
          
          #include <vector>
          
          #include <iomanip>
          
          #include <string.h>
          
          #include <algorithm>
          
          using namespace std;
          
          #define LL long long
          
          const int N = 1e5 + 10;
          
          const int INF = 0x3f3f3f3f;
          
          using namespace std;
          
          int num[15];
          
          int main()
          
          {
          
              int a,b,c;
          
              cin >> a >> b >> c;
          
              int p = 1;
          
              for(int i = 100;i <= 1000;i++)
          
              {
          
                  int x,y,z;
          
                  x = i;
          
                  y = i*b/a;
          
                  z = i*c/a;
          
                  if(x > 1000 || y > 1000||z > 1000)
          
                      continue;
          
                  memset(num,0,sizeof(num));
          
                  while(x)
          
                  {
          
                      num[ x%10]++;
          
                      x/=10;
          
                  }
          
                  x = y;
          
                  while(x)
          
                  {
          
                      num[ x%10]++;
          
                      x/=10;
          
                  }
          
                  x = z;
          
                  while(x)
          
                  {
          
                      num[ x%10]++;
          
                      x/=10;
          
                  }
          
                  int flag = 1;
          
                  for(int j = 1;j <= 9;j++)
          
                  {
          
                      if(num[j] != 1)
          
                      {
          
                          flag = 0;
          
                          break;
          
                      }
          
                  }
          
                  if(flag == 1)
          
                  {
          
                      p = 0;
          
                      cout << i << " " << y << " " << z << endl;
          
                  }
          
              }
              if(p)
          
                  puts("No!!!");
          
              return 0;
          
          }
          
          • 1

          信息

          ID
          899
          时间
          1000ms
          内存
          128MiB
          难度
          6
          标签
          递交数
          228
          已通过
          69
          上传者