n,m=map(int,input().split()) c=[] def dfs(a):     for i in range(len(a)):         if len(a)==1:             return         b=a[:]         b.pop(i)         xx=int(''.join(b))         if xx%m==0 and  xx not in c:             c.append(xx)         dfs(b)     return c print(dfs(list(str(n))))
点赞 评论

相关推荐

点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务