HDOJ 1239 Calling Extraterrestrial Intelligence Again

题目传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1239 搜索的题目。 我感觉这题直接判断是否满足条件就OK了,为何HDOJ的课件上还说用剪枝?谁能告诉我? 先分析:得到:2

HDOJ 1999 不可摸数

题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=1999 标准的筛选法。求出每个数的因子和, 然后看因子和是否在1000以内,是的话就证明等于因子和的这个数是不可摸数。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 #include <iostream> #include <string.h> #include <cmath> using namespace std;   int sum[1000001], sign[1001]; int main() { int nCases, num; scanf("%d", &nCases); for(int i = [...]

HDOJ 1406 完数

题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=1406 暴力~~~ 先开始在判断是否是完数时没优化: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 // Author: Tanky Woo // HDOJ 1406 [...]

HDOJ 3199 Hamming Problem

题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=3199 和 HDOJ 1508 丑数那题基本上一模一样。 这题虽然看起来数很大,但是认真分析会发现,其实数很小的,因为输出也小于10^18。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 // Author: Tanky Woo [...]

HDOJ 1508 Humble Numbers

题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=1058 Humble Numbers 丑数~~~ 汗,不知道为何叫这个名字,挺搞笑的。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 [...]