摘要: 1 O(n^2)的方法: 2 #include <iostream> 3 #include <stdio.h> 4 #include <cstring> 5 #include <algorithm> 6 using namespace std; 7 int a[15010],dp[15010],fr 阅读全文
posted @ 2017-08-07 18:08 wydxry 阅读(593) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <cstdio> 5 #include <vector> 6 #include <cstdlib> 7 #include <iomanip> 8 阅读全文
posted @ 2017-08-07 17:20 wydxry 阅读(409) 评论(0) 推荐(0) 编辑
摘要: HDU 2012 素数判定 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2012 对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39<=x<y<=50),判定该表达式的值是否都为素数。 Input输入数据有多组,每组占 阅读全文
posted @ 2017-08-07 16:54 wydxry 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=3624 Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the 阅读全文
posted @ 2017-08-07 16:24 wydxry 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1085 在N件物品取出若干件放在容量为W的背包里,每件物品的体积为W1,W2……Wn(Wi为整数),与之相对应的价值为P1,P2……Pn(Pi为整数)。求背包能够 阅读全文
posted @ 2017-08-07 16:20 wydxry 阅读(353) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=1789 Advanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other f 阅读全文
posted @ 2017-08-07 15:10 wydxry 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1996 n个盘子的汉诺塔问题的最少移动次数是2^n-1,即在移动过程中会产生2^n个系列。由于 发生错移产生的系列就增加了,这种错误是放错了柱子,并不会把大盘放到小盘上,即各柱 子从下往上的大小仍保持如下 阅读全文
posted @ 2017-08-07 10:47 wydxry 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2511 1,2,...,n表示n个盘子.数字大盘子就大.n个盘子放在第1根柱子上.大盘不能放在小盘上.在第1根柱子上的盘子是a[1],a[2],...,a[n]. a[1]=n,a[2]=n-1,..., 阅读全文
posted @ 2017-08-07 10:42 wydxry 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2175 1,2,...,n表示n个盘子.数字大盘子就大.n个盘子放在第1根柱子上.大盘不能放在小盘上. 在第1根柱子上的盘子是a[1],a[2],...,a[n]. a[1]=n,a[2]=n-1,... 阅读全文
posted @ 2017-08-07 10:26 wydxry 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2077 还记得汉诺塔III吗?他的规则是这样的:不允许直接从最左(右)边移到最右(左)边(每次移动一定是移到中间杆或从中间移出),也不允许大盘放到小盘的上面。xhd在想如果我们允许最大的盘子放到最上面会怎 阅读全文
posted @ 2017-08-07 10:14 wydxry 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2064 约19世纪末,在欧州的商店中出售一种智力玩具,在一块铜板上有三根杆,最左边的杆上自上而下、由小到大顺序串着由64个圆盘构成的塔。目的是将最左边杆上的盘全部移到右边的杆上,条件是一次只能移动一个盘, 阅读全文
posted @ 2017-08-07 10:00 wydxry 阅读(297) 评论(0) 推荐(0) 编辑
Live2D