摘要: 简单的素数问题 "HDOJ4548_美素数" include include include include bool num[1000005]={false,false,true};//初始化1不是素数,2为素数 int suShu[1000005]={0};//存储当前数字以内的美素数个数 in 阅读全文
posted @ 2019-03-01 16:12 heihuifei 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 正常简单题:通过仔细观察推断即可看出这是一个斐波拉契数列的题目。 "HDOJ2041_超级楼梯" 在做这题的时候我误入了思维盲区,只想着什么方法可以解决,没有看出是斐波拉契数列。因此第一次用组合数方法打了一次但是WA了,过程中我发现了WA的真正细节(整形数超过范围)还算是有所收获的。 组合数求和解 阅读全文
posted @ 2019-03-01 12:30 heihuifei 阅读(892) 评论(0) 推荐(1) 编辑
摘要: 水题 "HDOJ2013_蟠桃记" 阅读全文
posted @ 2019-03-01 11:06 heihuifei 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 水题:用数组标识各个阶段分数的等级即可。 "HDOJ2004_成绩转换" 阅读全文
posted @ 2019-03-01 10:55 heihuifei 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 一道水题。一直出现Output Limit Exceeded的原因是在while循环中没有终止条件的时候会自动判断并报错,写的时候忘记加!=EOF结束标识了。 "HDOJ2010_水仙花数" include include include include int main() { int num[1 阅读全文
posted @ 2019-03-01 10:37 heihuifei 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 这是一道水题,思路很简单,把杨辉三角先求出来,然后按照输入将相应的层数的杨慧三角输出即可。 "HDOJ2032_杨辉三角" include include include include int main() { int i,j,n; int tri[31][31]={0}; for(i=1;i 阅读全文
posted @ 2019-03-01 09:45 heihuifei 阅读(177) 评论(0) 推荐(0) 编辑