题目链接:http://acm.fzu.edu.cn/problem.php?pid=2128刚开始怎么也看不出来样例的答案;还好突然觉悟;具体看代码吧;#include#include#include#include#define N 1001000using namespace std;stru... Read More
posted @ 2015-08-19 19:22
西瓜不懂柠檬的酸
Views(139)
Comments(0)
Diggs(0)
题目链接:http://poj.org/problem?id=1184分析:首先可以发现有6*10^6种状态,比较多,不过搜索的时候可以去除一些无用的状态,可以发现一个点的值(2-5)如果想要改变那么光标必须在该点处,所以当光标在2-5位置时候,必须要要把值变为与目标位置处一样才可以移动。单搜:#i... Read More
posted @ 2015-08-19 10:24
西瓜不懂柠檬的酸
Views(301)
Comments(0)
Diggs(0)
题目链接:http://poj.org/problem?id=1564给出m个数,求出和为n的组合方式;并按从大到小的顺序输出;简单的dfs但是看了代码才会;#include #include #include #include using namespace std;int n, m, flag;... Read More
posted @ 2015-08-19 09:07
西瓜不懂柠檬的酸
Views(185)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号