hdu-题目:1058 Humble Numbes】的更多相关文章

http://acm.hdu.edu.cn/showproblem.php?pid=1058 Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20…
HDOJ(HDU).1058 Humble Numbers (DP) 点我挑战题目 题意分析 水 代码总览 /* Title:HDOJ.1058 Author:pengwill Date:2017-2-15 */ #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #define nmax 6000 #define min(a,b) (a<b?a:b…
题目1058:反序输出 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:9677 解决:3495 题目描述: 输入任意4个字符(如:abcd), 并按反序输出(如:dcba) 输入: 题目可能包含多组用例,每组用例占一行,包含4个任意的字符. 输出: 对于每组输入,请输出一行反序后的字符串.具体可见样例. 样例输入: Upin cvYj WJpw cXOA 样例输出: nipU jYvc wpJW AOXc #include <cstring> #include <cstdio…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1058 解题报告:输入一个n,输出第n个质因子只有2,3,5,7的数. 用了离线打表,因为n最大只有5842. #include<stdio.h> #define INT __int64 INT ans[] = { ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,…
Humble Number Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers. Write a program t…
Humble Numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 16742    Accepted Submission(s): 7280 Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble numb…
这题应该是用dp来做的吧,但一时不想思考了,写了个很暴力的,类似模拟打表,然后排序即可,要注意的是输出的格式,在这里wa了一发,看了别人的代码才知道哪些情况没考虑到. #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #define For(i,s,t) for(int i=s; i<=t; ++i) using namespace std; typedef l…
题意:给出丑数的定义,只含有2,3,5,7这四个素数因子的数称为素数.求第n个丑数. 可以先观察几个丑数得出规律 1:dp[1] 2:min(1*2,1*3,1*5,1*7) 3:min(2*2,1*3,1*5,1*7) 4:min(2*2,2*3,1*5,1*7) 5:min(3*2,2*3,1*5,1*7) 6:min(3*2,2*3,2*5,1*7) 7:min(4*2,3*3,2*5,1*7) 8:min(4*2,3*3,2*5,2*7) 9:min(5*2,3*3,2*5,2*7) 然…
Humble Numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18238    Accepted Submission(s): 7934 Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble numbe…
Humble Numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14584    Accepted Submission(s): 6313 Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble numbe…