Created
March 3, 2017 11:48
-
-
Save KhaledElshamy/fda842572916d892a28619d937b31dfc to your computer and use it in GitHub Desktop.
725-UVA Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// working.cpp by Bill Weinman <http://bw.org/> | |
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
int abcde,fghij,n; | |
while(cin>>n) | |
{ | |
for(fghij=1234;fghij<98765/n;fghij++) | |
{ | |
abcde=fghij*n; | |
int limit, use=(fghij<10000); | |
limit=abcde; | |
while(limit){use|=(1<<(limit%10));limit/=10;}; | |
limit=fghij; | |
while(limit){use|=(1<<(limit%10));limit/=10;}; | |
if(use==(1<<10)-1) | |
printf("%0.5d / %0.5d = %d\n", abcde, fghij, n); | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment