1 solutions

  • -3
    @ 2024-1-24 20:03:15

    #include <bits/stdc++.h> using namespace std;

    bool check(int x,int y,int z){ int a[10]={0}; int d=x%10; a[d]++; d=(x/10)%10; a[d]++; d=(x/100)%10; a[d]++; d=y%10; a[d]++; d=(y/10)%10; a[d]++; d=(y/100)%10; a[d]++; d=z%10; a[d]++; d=(z/10)%10; a[d]++; d=(z/100)%10; a[d]++;

    for(int i=1;i<=9;i++) if (a[i]!=1) return false; //cout<<a[i]<<" ";

    return true; } int main(){ long long A,B,C,x,y,z,v; cin>>A>>B>>C; int cnt=0; for(x=123;x<=987;x++){ y=xB/A; z=xC/A; if(y>=1000||z>=1000) continue;

    if(check(x,y,z)==true){ cout<<x<<" "<<y<<" "<<z<<endl; cnt++;

    } }

    if(cnt==0) cout<<"N0!!!";

    • 1

    Information

    ID
    394
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    10
    Tags
    # Submissions
    165
    Accepted
    4
    Uploaded By