A - Smith Numbers POJ】的更多相关文章

题意:给定一个N,求一个大于N的最小的Smith Numbers,Smith Numbers是一个合数,且分解质因数之后上质因子每一位上的数字之和 等于 其本身每一位数字之和(别的博客偷的题意) 思路:主要是分治:分解成质因子使用递归即可. #include<cstdio> #include<cmath> // 检测素数 bool is_prime(int n) { ; i*i <= n;++i) ){ ; } ; } //数位 int sumfun(int n) { ; ;…
While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University,noticed that the telephone number of his brother-in-law H. Smith had the following peculiar property: The sum of the digits of that number was equal to…
题意: 给你一个数x,把这个分解成素数之积(假设是x1*x2*x3),如果   x的每一数位的和   等于  x1每一数位的和加上x2每一数位的和加上x3每一数位的和,那么他就是题目要找的数 示例: 4937775 = 3 * 5 * 5 * 65837 电话号码的所有数字的和为4+9+3+7+7+7+5= 42,其质因数的数字的和为3+5+5+6+5+ 5+8+3+7=42. 题解: 暴力,具体见代码 代码: 1 #include<stdio.h> 2 #include<string.…
Description 题目描述 While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University, noticed that the telephone number of his brother-in-law H. Smith had the following peculiar property: The sum of the digits of that nu…
Description While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University,noticed that the telephone number of his brother-in-law H. Smith had the following peculiar property: The sum of the digits of that number w…
                               Smith Numbers Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 14521   Accepted: 4906 Description While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University,noticed tha…
欢迎访问我的新博客:http://www.milkcu.com/blog/ 原文地址:http://www.milkcu.com/blog/archives/uva10042.html 原创:Smith Numbers - PC110706 作者:MilkCu 题目描述 Smith Numbers   While skimming his phone directory in 1982, mathematician Albert Wilansky noticed that the telepho…
Poj1142 Smith Numbers Smith Numbers Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 13854 Accepted: 4716 Description While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University,noticed that the telepho…
Smith Numbers Background While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University , noticed that the telephone number of his brother-in-law H. Smith had the following peculiar property: The sum of the digits o…
Smith Numbers Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 14173   Accepted: 4838 Description While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University,noticed that the telephone number of his b…