acm question

https://icpcarchive.ecs.baylor.edu/external/20/2040.pdf

22
3
7
0
1

for input this

i dont under stand why out out is 110

is number should include 7?
The number may only use the specified digits, it does not have to use them. Read the question.
why they stop at 110 ?
my english is not very good please explain more
Last edited on
The goal is to find "the smallest strictly positive multiple of N that has no other digits"

So why stop at the smallest? Because that's what you're trying to find.
codeback99 wrote:
why they stop at 110 ?
cire wrote:
The goal is to find "the smallest strictly positive multiple of N that has no other digits"

smallest is the key as @cire pointed out. This means there will only be one smallest, so find it
In the above ex,
N = 22
M = 3

and M1, M2, M3 = { 7, 0, 1}

22*2 = 44
22*3 = 66
22*4 = 88

// Smallest multiple using the given no's (M1,..)
22*5 = 110

@kulkarnisr
how to understand "the smallest strictly positive multiple of N that has no other digits"? what's the meaning of "22*2 = 44,22 *3 = 66, 22 * 4 = 88"?
and then how to get the answer" 22*5 =110"?
Topic archived. No new replies allowed.