UVa10825 Anagram and Multiplication(dfs)

问题:一个n进制m位的数,在分别乘以2,3,...,m后得到的数是原数的一个排列,要求输出这样的数。其中3<=m<=6,4<=n<=100.

思路:如果尾数是0,显然不能满足条件。枚举尾数1-(n-1),分别乘以2,3,...,m对n取模得到的数是原数的其中一位数,然后枚举全排列,看是否满足条件。

具体代码参考:

https://github.com/wuli2496/OJ/tree/master/UVa/10825%20Anagram%20and%20Multiplication

发布了1365 篇原创文章 · 获赞 71 · 访问量 140万+

猜你喜欢

转载自blog.csdn.net/wuli2496/article/details/104313224